25 #ifndef GPU_MANAGER_H_ 26 #define GPU_MANAGER_H_ 29 #include <boost/scoped_array.hpp> 34 class VERTEX_CONTAINER;
35 class CACHED_CONTAINER;
36 class NONCACHED_CONTAINER;
61 virtual void DrawIndices(
unsigned int aOffset,
unsigned int aSize ) = 0;
109 virtual void DrawIndices(
unsigned int aOffset,
unsigned int aSize )
override;
112 virtual void DrawAll()
override;
125 void resizeIndices(
unsigned int aNewSize );
156 virtual void DrawIndices(
unsigned int aOffset,
unsigned int aSize )
override;
159 virtual void DrawAll()
override;
virtual void DrawIndices(unsigned int aOffset, unsigned int aSize)=0
Function DrawIndices() Makes the GPU draw given range of vertices.
virtual void SetShader(SHADER &aShader)
Function SetShader() Allows using shaders with the stored data.
unsigned int m_indicesCapacity
Current indices buffer size
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
int m_shaderAttrib
Location of shader attributes (for glVertexAttribPointer)
bool m_buffersInitialized
Buffers initialization flag
VERTEX_CONTAINER * m_container
Container that stores vertices data.
unsigned int m_indicesSize
Number of indices stored in the indices buffer
GLuint m_indicesBuffer
Handle to indices buffer
GLuint * m_indicesPtr
Pointer to the first free cell in the indices buffer
Class to handle uploading vertices and indices to GPU in drawing purposes.
static GPU_MANAGER * MakeManager(VERTEX_CONTAINER *aContainer)
Class SHADER provides the access to the OpenGL shaders.
virtual void DrawAll()=0
Function DrawIndices() Makes the GPU draw all the vertices stored in the container.
virtual void EndDrawing()=0
Function EndDrawing() Clears the container after drawing routines.
Common defines and consts used in vertex related classes.
bool m_isDrawing
Drawing status flag.
virtual void BeginDrawing()=0
Function BeginDrawing() Prepares the stored data to be drawn.
SHADER * m_shader
Shader handling
GPU_MANAGER(VERTEX_CONTAINER *aContainer)
boost::scoped_array< GLuint > m_indices
Pointer to the current indices buffer