changed event handling order to have custom handlers fire first

This commit is contained in:
Bob Polis 2020-10-24 23:15:21 +02:00
parent ec465820e8
commit 4e12340507

View File

@ -36,12 +36,12 @@ Window* Window::from_sdl(Uint32 window_id) {
}
bool Window::handle_window_event(const SDL_Event& event) {
bool quit {handle_global_event(event)};
bool quit {false};
Window* w {from_sdl(event.window.windowID)};
if (w) {
return w->handle_event(event, quit);
quit = w->handle_event(event, quit);
}
return quit;
return quit | handle_global_event(event);
}
bool Window::handle_global_event(const SDL_Event& event) {