Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
RenderQueue Class Reference

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

Public Types

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

Public Member Functions

 RenderQueue ()
 Constructor.
 
 RenderQueue ()
 Constructor.
 
 RenderQueue ()
 Constructor.
 
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.
 
var sort ()
 Sort the render commands.
 
local sort ()
 Sort the render commands.
 
RenderCommandoperator[] (ssize_t index) const
 Treat sorted commands as an array, access them one by one. More...
 
void clear ()
 Clear all rendered commands.
 
var clear ()
 Clear all rendered commands.
 
local clear ()
 Clear all rendered commands.
 
void realloc (size_t reserveSize)
 Realloc command queues and reserve with given size. More...
 
var realloc ( var reserveSize)
 Realloc command queues and reserve with given size. More...
 
local realloc ( local reserveSize)
 Realloc command queues and reserve with given size. 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...
 
void saveRenderState ()
 Save the current DepthState, CullState, DepthWriteState render state.
 
void restoreRenderState ()
 Restore the saved DepthState, CullState, DepthWriteState render state.
 

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 Function Documentation

void push_back ( RenderCommand command)

Push a renderCommand into current renderqueue.

The command to be pushed in to renderqueue

var push_back ( var  command)

Push a renderCommand into current renderqueue.

The command to be pushed in to renderqueue

local push_back ( local  command)

Push a renderCommand into current renderqueue.

The command to be pushed in to renderqueue

ssize_t size ( ) const

Return the number of render commands.

The number of render commands

var size ( )

Return the number of render commands.

The number of render commands

local size ( )

Return the number of render commands.

The number of render commands

RenderCommand* operator[] ( ssize_t  index) const

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

array index for commands the RenderCommand in the given index

RenderCommand* operator[] ( var  index)

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

array index for commands the RenderCommand in the given index

RenderCommand* operator[] ( local  index)

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

array index for commands the RenderCommand in the given index

void realloc ( size_t  reserveSize)

Realloc command queues and reserve with given size.

Note: this clears any existing commands. max size for command queue

var realloc ( var  reserveSize)

Realloc command queues and reserve with given size.

Note: this clears any existing commands. max size for command queue

local realloc ( local  reserveSize)

Realloc command queues and reserve with given size.

Note: this clears any existing commands. max size for command queue

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

Get a sub group of the render queue.

group ID for the sub queque render command array

var getSubQueue ( var  group)
inline

Get a sub group of the render queue.

group ID for the sub queque render command array

local getSubQueue ( local  group)
inline

Get a sub group of the render queue.

group ID for the sub queque render command array

ssize_t getSubQueueSize ( QUEUE_GROUP  group) const
inline

Get the number of render commands contained in a subqueue.

group ID for the sub queque the number of command in sub queque

var getSubQueueSize ( var  group)
inline

Get the number of render commands contained in a subqueue.

group ID for the sub queque the number of command in sub queque

local getSubQueueSize ( local  group)
inline

Get the number of render commands contained in a subqueue.

group ID for the sub queque the number of command in sub queque


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