Index

zydeco / 5a717fe

Experiment in graphics programming, C++, OpenGL, simulation techniques.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
916 Nov 2023 11:11a4d3636Fractal ViewerJosh Stockin133G

Blob @ zydeco / include / render / Renderer.hpp

text/plain1111 bytesdownload raw
1#ifndef RENDERER_HPP_
2#define RENDERER_HPP_
3
4
5#include "IUpdateable.hpp"
6#include "IEventWindowSubscriber.hpp"
7
8
9class IEventHandler;
10class IWindow;
11class ITimer;
12
13
14class Renderer : public IUpdateable, public IEventWindowSubscriber
15{
16public:
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
34private:
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