33 #if ( defined DC_BACKENDS_SHADERGL_X11 || defined DC_BACKENDS_SHADERGL_WIN32 )
36 #ifndef GLINTERFACE_H_INCLUDED
37 #define GLINTERFACE_H_INCLUDED
41 #include <Dynacoe/Backends/Renderer/Renderer.h>
45 #ifdef DC_BACKENDS_SHADERGL_X11
54 #include <Dynacoe/Backends/Renderer/ShaderGL/TextureManager.h>
55 #include <Dynacoe/Backends/Renderer/ShaderGL/Renderer2D.h>
67 struct ShaderGLRenderer :
public Dynacoe::Renderer {
72 std::string Version();
77 const uint32_t * indices,
81 uint32_t Add2DObject();
82 void Remove2DObject(uint32_t);
83 uint32_t Add2DVertex();
84 void Remove2DVertex(uint32_t
object);
85 void Set2DVertex(uint32_t vertex, Vertex2D);
86 Vertex2D Get2DVertex(uint32_t vertex);
87 void Set2DObjectParameters(uint32_t
object, Render2DObjectParameters);
88 void Render2DVertices(
const Render2DStaticParameters &);
91 void RenderStatic(StaticState *);
92 void ClearRenderedData();
93 RenderBufferID GetStaticViewingMatrixID();
94 RenderBufferID GetStaticProjectionMatrixID();
96 int AddTexture(
int,
int,
const uint8_t *);
97 void UpdateTexture(
int,
const uint8_t *);
98 void RemoveTexture(
int tex);
99 void GetTexture(
int, uint8_t*);
100 void SetTextureFilter(TexFilter);
101 TexFilter GetTextureFilter();
102 int GetTextureWidth(
int);
103 int GetTextureHeight(
int);
104 int MaxSimultaneousTextures();
106 RenderBufferID AddBuffer(
float *,
int);
107 void UpdateBuffer(RenderBufferID,
float *,
int,
int);
108 void ReadBuffer(RenderBufferID,
float *,
int,
int);
109 int BufferSize(RenderBufferID);
110 void RemoveBuffer(RenderBufferID);
113 LightID AddLight(LightType);
114 void UpdateLightAttributes(LightID,
float *);
115 void EnableLight(LightID,
bool doIt);
116 void RemoveLight(LightID);
117 int MaxEnabledLights();
120 std::string ProgramGetLanguage();
121 ProgramID ProgramGetBuiltIn(BuiltInShaderMode);
122 ProgramID ProgramAdd(
const std::string&,
const std::string &, std::string &);
125 bool IsSupported(Capability);
126 void SetDrawingMode(Polygon, Dimension, AlphaRule);
127 void GetDrawingMode(Polygon *, Dimension *, AlphaRule *);
130 std::vector<Dynacoe::Framebuffer::Type> SupportedFramebuffers();
131 TextureManager * GetTextureManager() {
return texture; }
134 double diagnostic_dynamic_vtex_per_render_accumulated_avg;
135 uint32_t diagnostic_dynamic_vtex_per_render_accumulated_avg_ct;
136 uint32_t diagnostic_dynamic_vtex_per_render_avg;
137 uint32_t diagnostic_dynamic_vtex_per_render_min;
138 uint32_t diagnostic_dynamic_vtex_per_render_max;
139 uint32_t diagnostic_dynamic_vtex_render_per_frame;
140 uint32_t diagnostic_dynamic_vtex_render_last;
141 time_t diagnostic_dynamic_vtex_render_frame_time;
142 uint32_t diagnostic_static_object_count_per_second;
143 time_t diagnostic_static_object_count_time;
144 uint32_t diagnostic_static_object_count_per_second_last;
145 double diagnostic_static_object_avg_indices_acc;
146 uint32_t diagnostic_static_object_avg_indices_ct;
147 uint32_t diagnostic_static_object_avg_indices;
150 void gl3warning(
const char *);
151 void gl3fatal(
const char *);
155 void resolveDisplayMode(Renderer::Polygon, Renderer::Dimension, Renderer::AlphaRule);
156 void resolveDisplayMode();
157 void onFirstAttach();
159 void initGLBuffers();
161 Display * attachedDisplay;
162 GLuint * texImageBounds;
164 TextureManager * texture;
165 Renderer2D * renderer2D;
172 Framebuffer * framebuffer;
174 void prepareTextures(StaticState*);
175 void framebufferCheck();
177 RenderBufferID mainProjectionUniform;
178 RenderBufferID mainViewUniform;
179 RenderBufferID mainTextureUniform;
180 RenderBufferID mainTextureUniform2;
181 RenderBufferID mainLightUniform;
182 RenderBufferID mainLightUniform2;
187 Dynacoe::LookupID basicProgramID;
188 Dynacoe::LookupID lightProgramID;
193 bool checkSupported();
194 bool createContext();
196 bool samplebufferSet;
197 GLuint lastSamplebuffer;
199 GLuint framebufferHandle;
202 GLuint framebufferTex;
207 AlphaRule curAlphaRule;
208 Dimension curDimension;
214 float * lightDataSrc;
215 float * lightDataSrc2;
216 void SyncLightBuffer();
Contains a visual state.
Definition: Framebuffer.h:49
An associative container that issues each member an ID guaranteed to be unique for the duration of th...
Definition: Table.h:58