changed event handling order to have custom handlers fire first
This commit is contained in:
parent
ec465820e8
commit
4e12340507
@ -36,12 +36,12 @@ Window* Window::from_sdl(Uint32 window_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Window::handle_window_event(const SDL_Event& event) {
|
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)};
|
Window* w {from_sdl(event.window.windowID)};
|
||||||
if (w) {
|
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) {
|
bool Window::handle_global_event(const SDL_Event& event) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user