Files
spectrum/source/core/eventmanager.hpp
T

27 lines
609 B
C++

// eventmanager.hpp
#include <SDL3/SDL.h>
class EventManager {
public:
void update() {
SDL_Event event;
while (SDL_PollEvent(&event)) {
if (event.type == SDL_EVENT_QUIT ||
event.type == SDL_EVENT_WINDOW_CLOSE_REQUESTED) {
if (!quit) {
quit = true;
SDL_LogInfo(
SDL_LOG_CATEGORY_APPLICATION,
"Someone wants to quit!");
}
}
}
}
auto wantToQuit() -> bool { return quit; }
private:
bool quit{false};
};