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

Base class of the RenderCommand hierarchy. More...

#include <CCRenderCommand.h>

Inheritance diagram for RenderCommand:
BatchCommand CustomCommand GroupCommand MeshCommand PrimitiveCommand QuadCommand TrianglesCommand

Public Types

enum  Type {
  UNKNOWN_COMMAND, QUAD_COMMAND, CUSTOM_COMMAND, BATCH_COMMAND,
  GROUP_COMMAND, MESH_COMMAND, PRIMITIVE_COMMAND, TRIANGLES_COMMAND
}
 Enum the type of render command. More...
 

Public Member Functions

void init (float globalZOrder, const Mat4 &modelViewTransform, uint32_t flags)
 Init function, will be called by all the render commands. More...
 
float getGlobalOrder () const
 Get global Z order. More...
 
Type getType () const
 Returns the Command type. More...
 
bool isTransparent () const
 Retruns whether is transparent. More...
 
void setTransparent (bool isTransparent)
 Set transparent flag. More...
 
bool isSkipBatching () const
 Get skip batching status, if a rendering is skip batching, it will be forced to be rendering seperately. More...
 
void setSkipBatching (bool value)
 Set skip batching. More...
 
local setSkipBatching ( local value)
 Set skip batching. More...
 
bool is3D () const
 Whether the command should be rendered at 3D mode. More...
 
void set3D (bool value)
 Set the command rendered in 3D mode or not. More...
 
float getDepth () const
 Get the depth by current model view matrix. More...
 

Protected Member Functions

 RenderCommand ()
 Constructor. More...
 
virtual ~RenderCommand ()
 Desctructor. More...
 
local ~RenderCommand ()
 Desctructor. More...
 
void printID ()

Protected Attributes

Type _type
 Type used in order to avoid dynamic cast, faster. More...
 
float _globalOrder
 Commands are sort by global Z order. More...
 
bool _isTransparent
 Transparent flag. More...
 
bool _skipBatching
 QuadCommand and TrianglesCommand could be auto batched if there material ID is the same, however, if a command is skip batching, it would be forced to draw in a seperate function call, and break the batch. More...
 
bool _is3D
 Is the command been rendered on 3D pass. More...
 
float _depth
 Depth from the model view matrix. More...
 

Detailed Description

Base class of the RenderCommand hierarchy.

The Renderer knows how to render RenderCommands objects.

Member Enumeration Documentation

enum Type
strong

Enum the type of render command.

Enumerator
UNKNOWN_COMMAND 

Reserved type.

QUAD_COMMAND 

Quad command, used for draw quad.

CUSTOM_COMMAND 

Custom command, used for calling callback for rendering.

BATCH_COMMAND 

Batch command, used for draw batches in texture atlas.

GROUP_COMMAND 

Group command, which can group command in a tree hierarchy.

MESH_COMMAND 

Mesh command, used to draw 3D meshes.

PRIMITIVE_COMMAND 

Primitive command, used to draw primitives such as lines, points and triangles.

TRIANGLES_COMMAND 

Triangles command, used to draw triangles.

var Type
strong

Enum the type of render command.

Enumerator
UNKNOWN_COMMAND 

Reserved type.

QUAD_COMMAND 

Quad command, used for draw quad.

CUSTOM_COMMAND 

Custom command, used for calling callback for rendering.

BATCH_COMMAND 

Batch command, used for draw batches in texture atlas.

GROUP_COMMAND 

Group command, which can group command in a tree hierarchy.

MESH_COMMAND 

Mesh command, used to draw 3D meshes.

PRIMITIVE_COMMAND 

Primitive command, used to draw primitives such as lines, points and triangles.

TRIANGLES_COMMAND 

Triangles command, used to draw triangles.

local Type
strong

Enum the type of render command.

Enumerator
UNKNOWN_COMMAND 

Reserved type.

QUAD_COMMAND 

Quad command, used for draw quad.

CUSTOM_COMMAND 

Custom command, used for calling callback for rendering.

BATCH_COMMAND 

Batch command, used for draw batches in texture atlas.

GROUP_COMMAND 

Group command, which can group command in a tree hierarchy.

MESH_COMMAND 

Mesh command, used to draw 3D meshes.

PRIMITIVE_COMMAND 

Primitive command, used to draw primitives such as lines, points and triangles.

TRIANGLES_COMMAND 

Triangles command, used to draw triangles.

Constructor & Destructor Documentation

RenderCommand ( )
protected

Constructor.

var RenderCommand ( )
protected

Constructor.

local RenderCommand ( )
protected

Constructor.

virtual ~RenderCommand ( )
protectedvirtual

Desctructor.

var ~RenderCommand ( )
protectedvirtual

Desctructor.

local ~RenderCommand ( )
protectedvirtual

Desctructor.

Member Function Documentation

float getDepth ( ) const
inline

Get the depth by current model view matrix.

var getDepth ( )
inline

Get the depth by current model view matrix.

local getDepth ( )
inline

Get the depth by current model view matrix.

float getGlobalOrder ( ) const
inline

Get global Z order.

var getGlobalOrder ( )
inline

Get global Z order.

local getGlobalOrder ( )
inline

Get global Z order.

Type getType ( ) const
inline

Returns the Command type.

var getType ( )
inline

Returns the Command type.

local getType ( )
inline

Returns the Command type.

void init ( float  globalZOrder,
const Mat4 modelViewTransform,
uint32_t  flags 
)

Init function, will be called by all the render commands.

Parameters
globalZOrderThe global order of command, used for rendercommand sorting.
modelViewTransformModelview matrix when submitting the render command.
flagsFlag used to indicate whether the command should be draw at 3D mode or not.
var init ( var  globalZOrder,
var  modelViewTransform,
var  flags 
)

Init function, will be called by all the render commands.

Parameters
globalZOrderThe global order of command, used for rendercommand sorting.
modelViewTransformModelview matrix when submitting the render command.
flagsFlag used to indicate whether the command should be draw at 3D mode or not.
local init ( local  globalZOrder,
local  modelViewTransform,
local  flags 
)

Init function, will be called by all the render commands.

Parameters
globalZOrderThe global order of command, used for rendercommand sorting.
modelViewTransformModelview matrix when submitting the render command.
flagsFlag used to indicate whether the command should be draw at 3D mode or not.
bool is3D ( ) const
inline

Whether the command should be rendered at 3D mode.

var is3D ( )
inline

Whether the command should be rendered at 3D mode.

local is3D ( )
inline

Whether the command should be rendered at 3D mode.

bool isSkipBatching ( ) const
inline

Get skip batching status, if a rendering is skip batching, it will be forced to be rendering seperately.

var isSkipBatching ( )
inline

Get skip batching status, if a rendering is skip batching, it will be forced to be rendering seperately.

local isSkipBatching ( )
inline

Get skip batching status, if a rendering is skip batching, it will be forced to be rendering seperately.

bool isTransparent ( ) const
inline

Retruns whether is transparent.

var isTransparent ( )
inline

Retruns whether is transparent.

local isTransparent ( )
inline

Retruns whether is transparent.

void printID ( )
protected
var printID ( )
protected
local printID ( )
protected
void set3D ( bool  value)
inline

Set the command rendered in 3D mode or not.

var set3D ( var  value)
inline

Set the command rendered in 3D mode or not.

local set3D ( local  value)
inline

Set the command rendered in 3D mode or not.

void setSkipBatching ( bool  value)
inline

Set skip batching.

var setSkipBatching ( var  value)
inline

Set skip batching.

local setSkipBatching ( local  value)
inline

Set skip batching.

void setTransparent ( bool  isTransparent)
inline

Set transparent flag.

var setTransparent ( var  isTransparent)
inline

Set transparent flag.

local setTransparent ( local  isTransparent)
inline

Set transparent flag.

Member Data Documentation

float _depth
protected

Depth from the model view matrix.

var _depth
protected

Depth from the model view matrix.

local _depth
protected

Depth from the model view matrix.

float _globalOrder
protected

Commands are sort by global Z order.

var _globalOrder
protected

Commands are sort by global Z order.

local _globalOrder
protected

Commands are sort by global Z order.

bool _is3D
protected

Is the command been rendered on 3D pass.

var _is3D
protected

Is the command been rendered on 3D pass.

local _is3D
protected

Is the command been rendered on 3D pass.

bool _isTransparent
protected

Transparent flag.

var _isTransparent
protected

Transparent flag.

local _isTransparent
protected

Transparent flag.

bool _skipBatching
protected

QuadCommand and TrianglesCommand could be auto batched if there material ID is the same, however, if a command is skip batching, it would be forced to draw in a seperate function call, and break the batch.

var _skipBatching
protected

QuadCommand and TrianglesCommand could be auto batched if there material ID is the same, however, if a command is skip batching, it would be forced to draw in a seperate function call, and break the batch.

local _skipBatching
protected

QuadCommand and TrianglesCommand could be auto batched if there material ID is the same, however, if a command is skip batching, it would be forced to draw in a seperate function call, and break the batch.

Type _type
protected

Type used in order to avoid dynamic cast, faster.

var _type
protected

Type used in order to avoid dynamic cast, faster.

local _type
protected

Type used in order to avoid dynamic cast, faster.


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