#include <CCRenderer.h>
Public Member Functions | |
| Renderer () | |
| ~Renderer () | |
| void | initGLView () |
| void | addCommand (RenderCommand *command) |
Adds a RenderComamnd into the renderer. More... | |
| void | addCommand (RenderCommand *command, int renderQueue) |
Adds a RenderComamnd into the renderer specifying a particular render queue ID. More... | |
| void | pushGroup (int renderQueueID) |
| Pushes a group into the render queue. More... | |
| void | popGroup () |
| Pops a group from the render queue. More... | |
| int | createRenderQueue () |
| Creates a render queue and returns its Id. More... | |
| void | render () |
Renders into the GLView all the queued RenderCommand objects. More... | |
| void | clean () |
Cleans all RenderCommands in the queue. More... | |
| void | clear () |
| Clear GL buffer and screen. More... | |
| void | setClearColor (const Color4F &clearColor) |
| set color for clear screen More... | |
| ssize_t | getDrawnBatches () const |
| void | addDrawnBatches (ssize_t number) |
| ssize_t | getDrawnVertices () const |
| void | addDrawnVertices (ssize_t number) |
| void | clearDrawStats () |
| void | setDepthTest (bool enable) |
| Enable/Disable depth test For 3D object depth test is enabled by default and can not be changed For 2D object depth test is disabled by default. More... | |
| GroupCommandManager * | getGroupCommandManager () const |
| bool | checkVisibility (const Mat4 &transform, const Size &size) |
| returns whether or not a rectangle is visible or not More... | |
Static Public Attributes | |
| static const int | VBO_SIZE = 65536 |
| static const int | INDEX_VBO_SIZE = VBO_SIZE * 6 / 4 |
| static const int | BATCH_QUADCOMMAND_RESEVER_SIZE = 64 |
| static const int | MATERIAL_ID_DO_NOT_BATCH = 0 |
Protected Member Functions | |
| void | setupBuffer () |
| void | setupVBOAndVAO () |
| void | setupVBO () |
| void | mapBuffers () |
| void | drawBatchedTriangles () |
| void | drawBatchedQuads () |
| void | flush () |
| void | flush2D () |
| void | flush3D () |
| void | flushQuads () |
| void | flushTriangles () |
| void | processRenderCommand (RenderCommand *command) |
| void | visitRenderQueue (RenderQueue &queue) |
| void | fillVerticesAndIndices (const TrianglesCommand *cmd) |
| void | fillQuads (const QuadCommand *cmd) |
Protected Attributes | |
| Color4F | _clearColor |
| std::stack< int > | _commandGroupStack |
| std::vector< RenderQueue > | _renderGroups |
| uint32_t | _lastMaterialID |
| MeshCommand * | _lastBatchedMeshCommand |
| std::vector< TrianglesCommand * > | _batchedCommands |
| std::vector< QuadCommand * > | _batchQuadCommands |
| V3F_C4B_T2F | _verts [VBO_SIZE] |
| GLushort | _indices [INDEX_VBO_SIZE] |
| GLuint | _buffersVAO |
| GLuint | _buffersVBO [2] |
| int | _filledVertex |
| int | _filledIndex |
| V3F_C4B_T2F | _quadVerts [VBO_SIZE] |
| GLushort | _quadIndices [INDEX_VBO_SIZE] |
| GLuint | _quadVAO |
| GLuint | _quadbuffersVBO [2] |
| int | _numberQuads |
| bool | _glViewAssigned |
| ssize_t | _drawnBatches |
| ssize_t | _drawnVertices |
| bool | _isRendering |
| bool | _isDepthTestFor2D |
| GroupCommandManager * | _groupCommandManager |
| Renderer | ( | ) |
| ~Renderer | ( | ) |
| void addCommand | ( | RenderCommand * | command | ) |
Adds a RenderComamnd into the renderer.
| void addCommand | ( | RenderCommand * | command, |
| int | renderQueue | ||
| ) |
Adds a RenderComamnd into the renderer specifying a particular render queue ID.
|
inline |
|
inline |
returns whether or not a rectangle is visible or not
| void clean | ( | ) |
Cleans all RenderCommands in the queue.
| void clear | ( | ) |
Clear GL buffer and screen.
|
inline |
| int createRenderQueue | ( | ) |
Creates a render queue and returns its Id.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
|
inline |
|
inline |
| void initGLView | ( | ) |
|
protected |
| void popGroup | ( | ) |
Pops a group from the render queue.
|
protected |
| void pushGroup | ( | int | renderQueueID | ) |
Pushes a group into the render queue.
| void render | ( | ) |
Renders into the GLView all the queued RenderCommand objects.
| void setClearColor | ( | const Color4F & | clearColor | ) |
set color for clear screen
| void setDepthTest | ( | bool | enable | ) |
Enable/Disable depth test For 3D object depth test is enabled by default and can not be changed For 2D object depth test is disabled by default.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
|
static |
|
static |