1 | #ifndef GL_RENDER_OBJECT_HPP_ |
2 | #define GL_RENDER_OBJECT_HPP_ |
3 |
|
4 |
|
5 | #include <list> |
6 | #include <map> |
7 |
|
8 | #include "ZydecoCommon.hpp" |
9 | #include "GLUniformUploader.hpp" |
10 |
|
11 |
|
12 | class GLProgram; |
13 | class GLTexture; |
14 |
|
15 |
|
16 | class GLRenderObject : public GLUniformUploader |
17 | { |
18 | public: |
19 | void RenderEnable(); |
20 | void RenderDisable(); |
21 |
|
22 | void AddTexture(uint64_t texture_unit, GLTexture *texture); |
23 |
|
24 | protected: |
25 | friend class Renderer; |
26 |
|
27 | GLRenderObject(std::string gl_program_name, uint64_t render_order); |
28 | ~GLRenderObject(); |
29 |
|
30 | virtual void Render() = 0; |
31 | static std::map<uint64_t, std::list<GLRenderObject*>>& GetRenderObjects(); |
32 | void GLTargetSetup(); |
33 | bool m_renderEnabled = true; |
34 |
|
35 | private: |
36 | static std::map<uint64_t, std::list<GLRenderObject*>> s_renderObjects; |
37 |
|
38 | GLProgram *m_glProgram; |
39 | uint64_t m_renderOrder; |
40 | std::map<uint64_t, GLTexture*> m_textures; |
41 | }; |
42 |
|
43 | #endif /* GL_RENDER_OBJECT_HPP_ */ |
44 |
|