1 | #ifndef EVENT_HANDLER_SDL2_HPP_ |
2 | #define EVENT_HANDLER_SDL2_HPP_ |
3 |
|
4 |
|
5 | #include <cstdint> |
6 | #include <vector> |
7 |
|
8 | #include "ZydecoCommon.hpp" |
9 | #include "IEventHandler.hpp" |
10 |
|
11 |
|
12 | class IEventKeyboardSubscriber; |
13 | class IEventMouseSubscriber; |
14 | class IEventQuitSubscriber; |
15 | class IEventWindowSubscriber; |
16 |
|
17 |
|
18 | class EventHandlerSDL2 : public IEventHandler |
19 | { |
20 | public: |
21 | EventHandlerSDL2(); |
22 | ~EventHandlerSDL2(); |
23 |
|
24 | bool Update() override; |
25 |
|
26 | bool RegisterKeyboardEventSubscriber(IEventKeyboardSubscriber *p_event_keyboard_subscriber) override; |
27 | bool RegisterMouseEventSubscriber(IEventMouseSubscriber *p_event_mouse_subscriber) override; |
28 | bool RegisterQuitEventSubscriber(IEventQuitSubscriber *p_event_quit_subscriber) override; |
29 | bool RegisterWindowEventSubscriber(IEventWindowSubscriber *p_event_window_subscriber) override; |
30 |
|
31 | private: |
32 | static constexpr uint64_t MAXIMUM_EVENT_SUBSCRIBERS = 8; |
33 |
|
34 | std::vector<IEventKeyboardSubscriber*> m_eventKeyboardSubscribers; |
35 | std::vector<IEventMouseSubscriber*> m_eventMouseSubscribers; |
36 | std::vector<IEventQuitSubscriber*> m_eventQuitSubscribers; |
37 | std::vector<IEventWindowSubscriber*> m_eventWindowSubscribers; |
38 | }; |
39 |
|
40 |
|
41 | #endif /* EVENT_HANDLER_SDL2_HPP_ */ |
42 |
|