moved window updating and runloop actions after event polling

This commit is contained in:
Bob Polis 2020-10-25 20:30:57 +01:00
parent deddc2bbea
commit 05cf3ba0e2

View File

@ -17,12 +17,6 @@ Application Application::app;
void Application::run() {
bool quit {false};
while (!quit) {
for (const Window& window : Window::windows()) {
window.update();
}
for (RunLoopAction action : _actions) {
action();
}
SDL_Event event;
if (SDL_PollEvent(&event)) {
switch (event.type) {
@ -36,6 +30,12 @@ void Application::run() {
quit = handle_event(event);
}
}
for (const Window& window : Window::windows()) {
window.update();
}
for (RunLoopAction action : _actions) {
action();
}
}
}