From 05cf3ba0e2caac67d5b094fcb7ba16ec5c13c6c7 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Sun, 25 Oct 2020 20:30:57 +0100 Subject: [PATCH] moved window updating and runloop actions after event polling --- Application.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Application.cpp b/Application.cpp index b591f2d..8e7457e 100644 --- a/Application.cpp +++ b/Application.cpp @@ -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(); + } } }