Implemented SDL event listener class and HUD toggle key (#4)

* Implemented SDL event listener class

* Add HUD toggle.

* frontend_listener: clean-up

* window: invoke all listener callbacks at once

* window: use raw pointers for listeners

* Rename WindowListener to SDLEventListener, reduce virtual functions

---------

Co-authored-by: RadiantDerg <jayvier13@gmail.com>
This commit is contained in:
Hyper
2024-11-10 18:23:36 +00:00
committed by GitHub
parent 21fc80798e
commit f157b21d67
6 changed files with 71 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
#include "window.h"
#include "sdl_listener.h"
#include <config.h>
#include <kernel/function.h>
#include <SDL_syswm.h>
@@ -107,6 +108,9 @@ int Window_OnSDLEvent(void*, SDL_Event* event)
}
}
for (auto listener : Window::s_eventListeners)
listener->OnSDLEvent(event);
return 0;
}