1 | #ifndef RENDERER_HPP_ |
2 | #define RENDERER_HPP_ |
3 |
|
4 |
|
5 | #include "IUpdateable.hpp" |
6 | #include "IEventWindowSubscriber.hpp" |
7 |
|
8 |
|
9 | class IEventHandler; |
10 | class IWindow; |
11 | class ITimer; |
12 |
|
13 |
|
14 | class Renderer : public IUpdateable, public IEventWindowSubscriber |
15 | { |
16 | public: |
17 | Renderer(IEventHandler& r_event_handler, IWindow& r_window, ITimer& r_timer); |
18 | ~Renderer() = default; |
19 |
|
20 | // public IUpdateable |
21 | bool Update() override; |
22 |
|
23 | // public IEventWindowSubscriber |
24 | void OnWindowMinimizedEvent() override; |
25 | void OnWindowMaximizedEvent() override; |
26 | void OnWindowRestoredEvent() override; |
27 | void OnWindowExposedEvent() override; |
28 | void OnWindowResizedEvent(uint64_t new_width, uint64_t new_height) override; |
29 | void OnWindowRequestedCloseEvent() override; |
30 |
|
31 | // Renderer |
32 | void UpdateDebug(); |
33 |
|
34 | private: |
35 | IWindow& m_rWindow; |
36 | ITimer& m_rTimer; |
37 | uint64_t m_windowWidth; |
38 | uint64_t m_windowHeight; |
39 |
|
40 | std::string m_glString; |
41 | std::string m_rendererString; |
42 | uint64_t m_frameTimeSum = 0; |
43 | uint64_t m_frameCount = 0; |
44 | float m_framerate = 0.0; |
45 |
|
46 | bool m_doRender; |
47 | }; |
48 |
|
49 |
|
50 | #endif /* RENDERER_HPP_ */ |
51 |
|