Move global maintains above rendering

Also moves the call to the AudioFrontend constructor to take place in the
GlobalState constructor


Former-commit-id: 0be9df5a7355b6a7d1ce758894568d67df7db11a
This commit is contained in:
Louis Pearson
2019-05-18 14:10:02 -06:00
parent 22286c24e6
commit 6b0fc57ce3
4 changed files with 11 additions and 12 deletions

View File

@ -86,6 +86,9 @@ impl PlayState for MainMenuState {
None => {}
}
// Maintain global_state
global_state.maintain();
// Maintain the UI.
for event in self.main_menu_ui.maintain(global_state) {
match event {
@ -124,9 +127,6 @@ impl PlayState for MainMenuState {
.swap_buffers()
.expect("Failed to swap window buffers!");
// Maintain global_state
global_state.maintain();
// Wait for the next tick
clock.tick(Duration::from_millis(1000 / FPS));
}