#pragma once #include "Event.h" #include #include #ifdef USE_SDL #include #endif class Object; class EventLoop { public: EventLoop(); ~EventLoop(); int exec(); void postEvent(Object* receiver, OwnPtr&&); static EventLoop& main(); static void initialize(); private: void waitForEvent(); #ifdef USE_SDL void handleKeyEvent(Event::Type, const SDL_KeyboardEvent&); #endif struct QueuedEvent { Object* receiver { nullptr }; OwnPtr event; }; Vector m_queuedEvents; };