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

Class that knows how to sort RenderCommand objects. More...

#include <CCRenderer.h>

Public Types

enum  QUEUE_GROUP {
  GLOBALZ_NEG = 0, OPAQUE_3D = 1, TRANSPARENT_3D = 2, GLOBALZ_ZERO = 3,
  GLOBALZ_POS = 4, QUEUE_COUNT = 5
}
 RenderCommand will be divided into Queue Groups. More...
 

Public Member Functions

 RenderQueue ()
 Constructor. More...
 
 RenderQueue ()
 Constructor. More...
 
 RenderQueue ()
 Constructor. More...
 
void push_back (RenderCommand *command)
 Push a renderCommand into current renderqueue. More...
 
var push_back ( var command)
 Push a renderCommand into current renderqueue. More...
 
local push_back ( local command)
 Push a renderCommand into current renderqueue. More...
 
ssize_t size () const
 Return the number of render commands. More...
 
void sort ()
 Sort the render commands. More...
 
RenderCommandoperator[] (ssize_t index) const
 Treat sorted commands as an array, access them one by one. More...
 
void clear ()
 Clear all rendered commands. More...
 
var clear ()
 Clear all rendered commands. More...
 
local clear ()
 Clear all rendered commands. More...
 
std::vector< RenderCommand * > & getSubQueue (QUEUE_GROUP group)
 Get a sub group of the render queue. More...
 
local getSubQueue ( local group)
 Get a sub group of the render queue. More...
 
ssize_t getSubQueueSize (QUEUE_GROUP group) const
 Get the number of render commands contained in a subqueue. More...
 
local getSubQueueSize ( local group)
 Get the number of render commands contained in a subqueue. More...
 
void saveRenderState ()
 Save the current DepthState, CullState, DepthWriteState render state. More...
 
void restoreRenderState ()
 Restore the saved DepthState, CullState, DepthWriteState render state. More...
 

Protected Attributes

std::vector< std::vector
< RenderCommand * > > 
_commands
 The commands in the render queue. More...
 
var _commands
 The commands in the render queue. More...
 
local _commands
 The commands in the render queue. More...
 
bool _isCullEnabled
 Cull state. More...
 
var _isCullEnabled
 Cull state. More...
 
local _isCullEnabled
 Cull state. More...
 
bool _isDepthEnabled
 Depth test enable state. More...
 
var _isDepthEnabled
 Depth test enable state. More...
 
local _isDepthEnabled
 Depth test enable state. More...
 
GLboolean _isDepthWrite
 Depth buffer write state. More...
 
var _isDepthWrite
 Depth buffer write state. More...
 
local _isDepthWrite
 Depth buffer write state. More...
 

Detailed Description

Class that knows how to sort RenderCommand objects.

Since the commands that have z == 0 are "pushed back" in the correct order, the only RenderCommand objects that need to be sorted, are the ones that have z < 0 and z > 0.

Member Enumeration Documentation

RenderCommand will be divided into Queue Groups.

Enumerator
GLOBALZ_NEG 

Objects with globalZ smaller than 0.

OPAQUE_3D 

Opaque 3D objects with 0 globalZ.

TRANSPARENT_3D 

Transparent 3D objects with 0 globalZ.

GLOBALZ_ZERO 

2D objects with 0 globalZ.

GLOBALZ_POS 

Objects with globalZ bigger than 0.

QUEUE_COUNT 

RenderCommand will be divided into Queue Groups.

Enumerator
GLOBALZ_NEG 

Objects with globalZ smaller than 0.

OPAQUE_3D 

Opaque 3D objects with 0 globalZ.

TRANSPARENT_3D 

Transparent 3D objects with 0 globalZ.

GLOBALZ_ZERO 

2D objects with 0 globalZ.

GLOBALZ_POS 

Objects with globalZ bigger than 0.

QUEUE_COUNT 
local QUEUE_GROUP

RenderCommand will be divided into Queue Groups.

Enumerator
GLOBALZ_NEG 

Objects with globalZ smaller than 0.

OPAQUE_3D 

Opaque 3D objects with 0 globalZ.

TRANSPARENT_3D 

Transparent 3D objects with 0 globalZ.

GLOBALZ_ZERO 

2D objects with 0 globalZ.

GLOBALZ_POS 

Objects with globalZ bigger than 0.

QUEUE_COUNT 

Constructor & Destructor Documentation

RenderQueue ( )
inline

Constructor.

var RenderQueue ( )
inline

Constructor.

local RenderQueue ( )
inline

Constructor.

Member Function Documentation

void clear ( )

Clear all rendered commands.

var clear ( )

Clear all rendered commands.

local clear ( )

Clear all rendered commands.

std::vector<RenderCommand*>
& getSubQueue
( QUEUE_GROUP  group)
inline

Get a sub group of the render queue.

var getSubQueue ( var  group)
inline

Get a sub group of the render queue.

local getSubQueue ( local  group)
inline

Get a sub group of the render queue.

ssize_t getSubQueueSize ( QUEUE_GROUP  group) const
inline

Get the number of render commands contained in a subqueue.

var getSubQueueSize ( var  group)
inline

Get the number of render commands contained in a subqueue.

local getSubQueueSize ( local  group)
inline

Get the number of render commands contained in a subqueue.

RenderCommand* operator[] ( ssize_t  index) const

Treat sorted commands as an array, access them one by one.

RenderCommand* operator[] ( var  index)

Treat sorted commands as an array, access them one by one.

RenderCommand* operator[] ( local  index)

Treat sorted commands as an array, access them one by one.

void push_back ( RenderCommand command)

Push a renderCommand into current renderqueue.

var push_back ( var  command)

Push a renderCommand into current renderqueue.

local push_back ( local  command)

Push a renderCommand into current renderqueue.

void restoreRenderState ( )

Restore the saved DepthState, CullState, DepthWriteState render state.

var restoreRenderState ( )

Restore the saved DepthState, CullState, DepthWriteState render state.

local restoreRenderState ( )

Restore the saved DepthState, CullState, DepthWriteState render state.

void saveRenderState ( )

Save the current DepthState, CullState, DepthWriteState render state.

var saveRenderState ( )

Save the current DepthState, CullState, DepthWriteState render state.

local saveRenderState ( )

Save the current DepthState, CullState, DepthWriteState render state.

ssize_t size ( ) const

Return the number of render commands.

var size ( )

Return the number of render commands.

local size ( )

Return the number of render commands.

void sort ( )

Sort the render commands.

var sort ( )

Sort the render commands.

local sort ( )

Sort the render commands.

Member Data Documentation

std::vector<std::vector
<RenderCommand*> > _commands
protected

The commands in the render queue.

var _commands
protected

The commands in the render queue.

local _commands
protected

The commands in the render queue.

bool _isCullEnabled
protected

Cull state.

var _isCullEnabled
protected

Cull state.

local _isCullEnabled
protected

Cull state.

bool _isDepthEnabled
protected

Depth test enable state.

var _isDepthEnabled
protected

Depth test enable state.

local _isDepthEnabled
protected

Depth test enable state.

GLboolean _isDepthWrite
protected

Depth buffer write state.

var _isDepthWrite
protected

Depth buffer write state.

local _isDepthWrite
protected

Depth buffer write state.


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