cocos2d-x  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Renderer Class Reference

#include <CCRenderer.h>

Public Member Functions

 Renderer ()
 Renderer ()
 Renderer ()
 ~Renderer ()
 ~Renderer ()
 ~Renderer ()
void initGLView ()
var initGLView ()
local initGLView ()
void addCommand (RenderCommand *command)
 Adds a RenderComamnd into the renderer. More...
 
var addCommand ( var command)
 Adds a RenderComamnd into the renderer. More...
 
local addCommand ( local 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...
 
var addCommand ( var command, var renderQueue)
 Adds a RenderComamnd into the renderer specifying a particular render queue ID. More...
 
local addCommand ( local command, local 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...
 
var pushGroup ( var renderQueueID)
 Pushes a group into the render queue. More...
 
local pushGroup ( local 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...
 
var createRenderQueue ()
 Creates a render queue and returns its Id. More...
 
local 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...
 
ssize_t getDrawnBatches () const
var getDrawnBatches ()
local getDrawnBatches ()
void addDrawnBatches (ssize_t number)
local addDrawnBatches ( local number)
ssize_t getDrawnVertices () const
var getDrawnVertices ()
local getDrawnVertices ()
void addDrawnVertices (ssize_t number)
var addDrawnVertices ( var number)
local addDrawnVertices ( local number)
void clearDrawStats ()
var clearDrawStats ()
local clearDrawStats ()
GroupCommandManagergetGroupCommandManager () const
var getGroupCommandManager ()
local getGroupCommandManager ()
bool checkVisibility (const Mat4 &transform, const Size &size)
 returns whether or not a rectangle is visible or not More...
 
var checkVisibility ( var transform, var size)
 returns whether or not a rectangle is visible or not More...
 
local checkVisibility ( local transform, local size)
 returns whether or not a rectangle is visible or not More...
 

Static Public Attributes

static const int VBO_SIZE = 65536
var VBO_SIZE = 65536
local VBO_SIZE = 65536
static const int INDEX_VBO_SIZE = VBO_SIZE * 6 / 4
var INDEX_VBO_SIZE = VBO_SIZE * 6 / 4
local INDEX_VBO_SIZE = VBO_SIZE * 6 / 4
static const int BATCH_QUADCOMMAND_RESEVER_SIZE = 64
var BATCH_QUADCOMMAND_RESEVER_SIZE = 64
local BATCH_QUADCOMMAND_RESEVER_SIZE = 64
static const int MATERIAL_ID_DO_NOT_BATCH = 0
var MATERIAL_ID_DO_NOT_BATCH = 0
local MATERIAL_ID_DO_NOT_BATCH = 0

Protected Member Functions

void setupBuffer ()
var setupBuffer ()
local setupBuffer ()
void setupVBOAndVAO ()
var setupVBOAndVAO ()
local setupVBOAndVAO ()
void setupVBO ()
var setupVBO ()
local setupVBO ()
void mapBuffers ()
var mapBuffers ()
local mapBuffers ()
void drawBatchedTriangles ()
local drawBatchedTriangles ()
void drawBatchedQuads ()
var drawBatchedQuads ()
local drawBatchedQuads ()
void flush ()
var flush ()
local flush ()
void flush2D ()
var flush2D ()
local flush2D ()
void flush3D ()
var flush3D ()
local flush3D ()
void visitRenderQueue (const RenderQueue &queue)
var visitRenderQueue ( var queue)
local visitRenderQueue ( local queue)
void visitTransparentRenderQueue (const TransparentRenderQueue &queue)
local visitTransparentRenderQueue ( local queue)
void fillVerticesAndIndices (const TrianglesCommand *cmd)
var fillVerticesAndIndices ( var cmd)
local fillVerticesAndIndices ( local cmd)
void fillQuads (const QuadCommand *cmd)
var fillQuads ( var cmd)
local fillQuads ( local cmd)

Protected Attributes

std::stack< int > _commandGroupStack
std::vector< RenderQueue_renderGroups
var _renderGroups
local _renderGroups
TransparentRenderQueue _transparentRenderGroups
var _transparentRenderGroups
local _transparentRenderGroups
uint32_t _lastMaterialID
var _lastMaterialID
local _lastMaterialID
MeshCommand_lastBatchedMeshCommand
var _lastBatchedMeshCommand
local _lastBatchedMeshCommand
std::vector< TrianglesCommand * > _batchedCommands
var _batchedCommands
local _batchedCommands
std::vector< QuadCommand * > _batchQuadCommands
var _batchQuadCommands
local _batchQuadCommands
V3F_C4B_T2F _verts [VBO_SIZE]
var _verts ()
local _verts ()
GLushort _indices [INDEX_VBO_SIZE]
var _indices ()
local _indices ()
GLuint _buffersVAO
var _buffersVAO
local _buffersVAO
GLuint _buffersVBO [2]
var _buffersVBO ()
local _buffersVBO ()
int _filledVertex
var _filledVertex
local _filledVertex
int _filledIndex
var _filledIndex
local _filledIndex
V3F_C4B_T2F _quadVerts [VBO_SIZE]
var _quadVerts ()
local _quadVerts ()
GLushort _quadIndices [INDEX_VBO_SIZE]
var _quadIndices ()
local _quadIndices ()
GLuint _quadVAO
var _quadVAO
local _quadVAO
GLuint _quadbuffersVBO [2]
var _quadbuffersVBO ()
local _quadbuffersVBO ()
int _numberQuads
var _numberQuads
local _numberQuads
bool _glViewAssigned
var _glViewAssigned
local _glViewAssigned
ssize_t _drawnBatches
var _drawnBatches
local _drawnBatches
ssize_t _drawnVertices
var _drawnVertices
local _drawnVertices
bool _isRendering
var _isRendering
local _isRendering
GroupCommandManager_groupCommandManager
var _groupCommandManager
local _groupCommandManager

Constructor & Destructor Documentation

Renderer ( )
var Renderer ( )
local Renderer ( )
~Renderer ( )
var ~Renderer ( )
local ~Renderer ( )

Member Function Documentation

void addCommand ( RenderCommand command)

Adds a RenderComamnd into the renderer.

var addCommand ( var  command)

Adds a RenderComamnd into the renderer.

local addCommand ( local  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.

var addCommand ( var  command,
var  renderQueue 
)

Adds a RenderComamnd into the renderer specifying a particular render queue ID.

local addCommand ( local  command,
local  renderQueue 
)

Adds a RenderComamnd into the renderer specifying a particular render queue ID.

void addDrawnBatches ( ssize_t  number)
inline
var addDrawnBatches ( var  number)
inline
local addDrawnBatches ( local  number)
inline
void addDrawnVertices ( ssize_t  number)
inline
var addDrawnVertices ( var  number)
inline
local addDrawnVertices ( local  number)
inline
bool checkVisibility ( const Mat4 transform,
const Size size 
)

returns whether or not a rectangle is visible or not

var checkVisibility ( var  transform,
var  size 
)

returns whether or not a rectangle is visible or not

local checkVisibility ( local  transform,
local  size 
)

returns whether or not a rectangle is visible or not

void clean ( )

Cleans all RenderCommands in the queue.

var clean ( )

Cleans all RenderCommands in the queue.

local clean ( )

Cleans all RenderCommands in the queue.

void clearDrawStats ( )
inline
var clearDrawStats ( )
inline
local clearDrawStats ( )
inline
int createRenderQueue ( )

Creates a render queue and returns its Id.

var createRenderQueue ( )

Creates a render queue and returns its Id.

local createRenderQueue ( )

Creates a render queue and returns its Id.

void drawBatchedQuads ( )
protected
var drawBatchedQuads ( )
protected
local drawBatchedQuads ( )
protected
void drawBatchedTriangles ( )
protected
var drawBatchedTriangles ( )
protected
local drawBatchedTriangles ( )
protected
void fillQuads ( const QuadCommand cmd)
protected
var fillQuads ( var  cmd)
protected
local fillQuads ( local  cmd)
protected
void fillVerticesAndIndices ( const TrianglesCommand cmd)
protected
var fillVerticesAndIndices ( var  cmd)
protected
local fillVerticesAndIndices ( local  cmd)
protected
void flush ( )
protected
var flush ( )
protected
local flush ( )
protected
void flush2D ( )
protected
var flush2D ( )
protected
local flush2D ( )
protected
void flush3D ( )
protected
var flush3D ( )
protected
local flush3D ( )
protected
ssize_t getDrawnBatches ( ) const
inline
var getDrawnBatches ( )
inline
local getDrawnBatches ( )
inline
ssize_t getDrawnVertices ( ) const
inline
var getDrawnVertices ( )
inline
local getDrawnVertices ( )
inline
GroupCommandManager*
getGroupCommandManager
( ) const
inline
var getGroupCommandManager ( )
inline
local getGroupCommandManager ( )
inline
void initGLView ( )
var initGLView ( )
local initGLView ( )
void mapBuffers ( )
protected
var mapBuffers ( )
protected
local mapBuffers ( )
protected
void popGroup ( )

Pops a group from the render queue.

var popGroup ( )

Pops a group from the render queue.

local popGroup ( )

Pops a group from the render queue.

void pushGroup ( int  renderQueueID)

Pushes a group into the render queue.

var pushGroup ( var  renderQueueID)

Pushes a group into the render queue.

local pushGroup ( local  renderQueueID)

Pushes a group into the render queue.

void render ( )

Renders into the GLView all the queued RenderCommand objects.

var render ( )

Renders into the GLView all the queued RenderCommand objects.

local render ( )

Renders into the GLView all the queued RenderCommand objects.

void setupBuffer ( )
protected
var setupBuffer ( )
protected
local setupBuffer ( )
protected
void setupVBO ( )
protected
var setupVBO ( )
protected
local setupVBO ( )
protected
void setupVBOAndVAO ( )
protected
var setupVBOAndVAO ( )
protected
local setupVBOAndVAO ( )
protected
void visitRenderQueue ( const RenderQueue queue)
protected
var visitRenderQueue ( var  queue)
protected
local visitRenderQueue ( local  queue)
protected
void visitTransparentRenderQueue ( const TransparentRenderQueue queue)
protected
var visitTransparentRenderQueue ( var  queue)
protected
local visitTransparentRenderQueue ( local  queue)
protected

Member Data Documentation

std::vector<TrianglesCommand*>
_batchedCommands
protected
var _batchedCommands
protected
local _batchedCommands
protected
std::vector<QuadCommand*>
_batchQuadCommands
protected
var _batchQuadCommands
protected
local _batchQuadCommands
protected
GLuint _buffersVAO
protected
var _buffersVAO
protected
local _buffersVAO
protected
GLuint _buffersVBO[2]
protected
GLuint _buffersVBO[2]
protected
GLuint _buffersVBO[2]
protected
std::stack<int> _commandGroupStack
protected
var _commandGroupStack
protected
local _commandGroupStack
protected
ssize_t _drawnBatches
protected
var _drawnBatches
protected
local _drawnBatches
protected
ssize_t _drawnVertices
protected
var _drawnVertices
protected
local _drawnVertices
protected
int _filledIndex
protected
var _filledIndex
protected
local _filledIndex
protected
int _filledVertex
protected
var _filledVertex
protected
local _filledVertex
protected
bool _glViewAssigned
protected
var _glViewAssigned
protected
local _glViewAssigned
protected
GroupCommandManager*
_groupCommandManager
protected
var _groupCommandManager
protected
local _groupCommandManager
protected
GLushort _indices[INDEX_VBO_SIZE]
protected
GLushort _indices[INDEX_VBO_SIZE]
protected
GLushort _indices[INDEX_VBO_SIZE]
protected
bool _isRendering
protected
var _isRendering
protected
local _isRendering
protected
MeshCommand*
_lastBatchedMeshCommand
protected
var _lastBatchedMeshCommand
protected
local _lastBatchedMeshCommand
protected
uint32_t _lastMaterialID
protected
var _lastMaterialID
protected
local _lastMaterialID
protected
int _numberQuads
protected
var _numberQuads
protected
local _numberQuads
protected
GLuint _quadbuffersVBO[2]
protected
GLuint _quadbuffersVBO[2]
protected
GLuint _quadbuffersVBO[2]
protected
GLushort _quadIndices[INDEX_VBO_SIZE]
protected
GLushort _quadIndices[INDEX_VBO_SIZE]
protected
GLushort _quadIndices[INDEX_VBO_SIZE]
protected
GLuint _quadVAO
protected
var _quadVAO
protected
local _quadVAO
protected
V3F_C4B_T2F _quadVerts[VBO_SIZE]
protected
V3F_C4B_T2F _quadVerts[VBO_SIZE]
protected
V3F_C4B_T2F _quadVerts[VBO_SIZE]
protected
std::vector<RenderQueue>
_renderGroups
protected
var _renderGroups
protected
local _renderGroups
protected
TransparentRenderQueue
_transparentRenderGroups
protected
var _transparentRenderGroups
protected
local _transparentRenderGroups
protected
V3F_C4B_T2F _verts[VBO_SIZE]
protected
V3F_C4B_T2F _verts[VBO_SIZE]
protected
V3F_C4B_T2F _verts[VBO_SIZE]
protected
const int
BATCH_QUADCOMMAND_RESEVER_SIZE = 64
static
var BATCH_QUADCOMMAND_RESEVER_SIZE = 64
static
local
BATCH_QUADCOMMAND_RESEVER_SIZE = 64
static
const int INDEX_VBO_SIZE = VBO_SIZE * 6 / 4
static
var INDEX_VBO_SIZE = VBO_SIZE * 6 / 4
static
local INDEX_VBO_SIZE = VBO_SIZE * 6 / 4
static
const int MATERIAL_ID_DO_NOT_BATCH = 0
static
var MATERIAL_ID_DO_NOT_BATCH = 0
static
local MATERIAL_ID_DO_NOT_BATCH = 0
static
const int VBO_SIZE = 65536
static
var VBO_SIZE = 65536
static
local VBO_SIZE = 65536
static

The documentation for this class was generated from the following file: