Index

zydeco / fractal

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
1008 Dec 2023 15:215a717feFractal renderer update for articleJosh Stockin1341G

Blob @ zydeco / include / render / gl / GLRenderObject.hpp

text/plain900 bytesdownload raw
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
12class GLProgram;
13class GLTexture;
14
15
16class GLRenderObject : public GLUniformUploader
17{
18public:
19 void RenderEnable();
20 void RenderDisable();
21
22 void AddTexture(uint64_t texture_unit, GLTexture *texture);
23
24protected:
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
35private:
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