28#include <boost/scoped_array.hpp>
103 VRANGE(
int aStart,
int aEnd,
bool aContinuous ) :
Class to store VERTEX instances with caching.
int m_totalHuge
Number of huge VRANGEs (i.e. large zones) with separate draw calls.
std::vector< VRANGE > m_vranges
Ranges of visible vertex indices to render.
unsigned int m_indexBufMaxSize
Maximum size taken by the index buffer for all frames rendered so far.
unsigned int m_indicesCapacity
Current indices buffer size.
unsigned int m_curVrangeSize
Size of the current VRANGE.
GPU_CACHED_MANAGER(VERTEX_CONTAINER *aContainer)
virtual void DrawIndices(const VERTEX_ITEM *aItem) override
Make the GPU draw given range of vertices.
virtual void BeginDrawing() override
Prepare the stored data to be drawn.
bool m_buffersInitialized
Buffers initialization flag.
int m_totalNormal
Number of regular VRANGEs (small items) pooled into single draw call.
boost::scoped_array< GLuint > m_indices
Pointer to the current indices buffer.
unsigned int m_indexBufSize
Current size of index buffer.
void Map()
Map vertex buffer stored in GPU memory.
void Unmap()
Unmap vertex buffer.
void resizeIndices(unsigned int aNewSize)
Resizes the indices buffer to aNewSize if necessary.
virtual void EndDrawing() override
Clear the container after drawing routines.
GPU_MANAGER(VERTEX_CONTAINER *aContainer)
int m_shaderAttrib
Location of shader attributes (for glVertexAttribPointer)
virtual void SetShader(SHADER &aShader)
Allow using shaders with the stored data.
virtual void DrawIndices(const VERTEX_ITEM *aItem)=0
Make the GPU draw given range of vertices.
void EnableDepthTest(bool aEnabled)
Enable/disable Z buffer depth test.
VERTEX_CONTAINER * m_container
Container that stores vertices data.
bool m_enableDepthTest
true: enable Z test when drawing
virtual void BeginDrawing()=0
Prepare the stored data to be drawn.
bool m_isDrawing
Drawing status flag.
static GPU_MANAGER * MakeManager(VERTEX_CONTAINER *aContainer)
SHADER * m_shader
Shader handling.
virtual void EndDrawing()=0
Clear the container after drawing routines.
virtual void BeginDrawing() override
Prepare the stored data to be drawn.
GPU_NONCACHED_MANAGER(VERTEX_CONTAINER *aContainer)
virtual void EndDrawing() override
Clear the container after drawing routines.
virtual void DrawIndices(const VERTEX_ITEM *aItem) override
Make the GPU draw given range of vertices.
Provide the access to the OpenGL shaders.
The Cairo implementation of the graphics abstraction layer.
VRANGE(int aStart, int aEnd, bool aContinuous)
Common defines and consts used in vertex related classes.