Cocos2d-x  v3.17
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
PrimitiveCommand Class Reference

Command used to render primitive, similar to QuadCommand. More...

Inherits RenderCommand.

Public Member Functions

void init (float globalOrder, GLuint textureID, GLProgramState *glProgramState, BlendFunc blendType, Primitive *primitive, const Mat4 &mv, uint32_t flags)
 Initializes the command. More...
 
uint32_t getMaterialID () const
 Get the generated material ID. More...
 
GLuint getTextureID () const
 Get the texture ID used for drawing. More...
 
local getTextureID ()
 Get the texture ID used for drawing. More...
 
GLProgramStategetGLProgramState () const
 Get the glprogramstate used for drawing. More...
 
var getGLProgramState ()
 Get the glprogramstate used for drawing. More...
 
local getGLProgramState ()
 Get the glprogramstate used for drawing. More...
 
BlendFunc getBlendType () const
 Get the blend function for drawing. More...
 
local getBlendType ()
 Get the blend function for drawing. More...
 
const Mat4getModelView () const
 Get the modelview matrix when draw the primitive. More...
 
local getModelView ()
 Get the modelview matrix when draw the primitive. More...
 
void execute () const
 Execute and draw the command, called by renderer. More...
 
local execute ()
 Execute and draw the command, called by renderer. More...
 
 PrimitiveCommand ()
 PrimitiveCommand ()
 PrimitiveCommand ()
- Public Member Functions inherited from RenderCommand
void init (float globalZOrder, const Mat4 &modelViewTransform, uint32_t flags)
 Init function, will be called by all the render commands. More...
 
var init ( var globalZOrder, var modelViewTransform, var flags)
 Init function, will be called by all the render commands. More...
 
local init ( local globalZOrder, local modelViewTransform, local flags)
 Init function, will be called by all the render commands. More...
 
float getGlobalOrder () const
 Get global Z order. More...
 
local getGlobalOrder ()
 Get global Z order. More...
 
Type getType () const
 Returns the Command type. More...
 
local getType ()
 Returns the Command type. More...
 
bool isTransparent () const
 Returns whether is transparent. More...
 
local isTransparent ()
 Returns whether is transparent. More...
 
void setTransparent (bool isTransparent)
 Set transparent flag. More...
 
var setTransparent ( var isTransparent)
 Set transparent flag. More...
 
local setTransparent ( local 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 separately.
 
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...
 
var is3D ()
 Whether the command should be rendered at 3D mode. More...
 
local is3D ()
 Whether the command should be rendered at 3D mode. More...
 
void set3D (bool value)
 Set the command rendered in 3D mode or not. More...
 
var set3D ( var value)
 Set the command rendered in 3D mode or not. More...
 
local set3D ( local value)
 Set the command rendered in 3D mode or not. More...
 
float getDepth () const
 Get the depth by current model view matrix. More...
 
local getDepth ()
 Get the depth by current model view matrix. More...
 

Additional Inherited Members

- Public Types inherited from RenderCommand
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...
 

Detailed Description

Command used to render primitive, similar to QuadCommand.

Every QuadCommand will have generate material ID by give textureID, glProgramState, Blend function. However, primitive command could not be batched.

Constructor & Destructor Documentation

Constructor and Destructor.

Constructor and Destructor.

local PrimitiveCommand ( )

Constructor and Destructor.

Member Function Documentation

void init ( float  globalOrder,
GLuint  textureID,
GLProgramState glProgramState,
BlendFunc  blendType,
Primitive primitive,
const Mat4 mv,
uint32_t  flags 
)

Initializes the command.

Parameters
globalOrderGlobalZOrder of the command.
textureIDThe openGL handle of the used texture.
glProgramStateThe specified glProgram and its uniform.
blendTypeBlend function for the command.
primitiveRendered primitive for the command.
mvModelView matrix for the command.
flagsto indicate that the command is using 3D rendering or not.
var init ( var  globalOrder,
var  textureID,
var  glProgramState,
var  blendType,
var  primitive,
var  mv,
var  flags 
)

Initializes the command.

Parameters
globalOrderGlobalZOrder of the command.
textureIDThe openGL handle of the used texture.
glProgramStateThe specified glProgram and its uniform.
blendTypeBlend function for the command.
primitiveRendered primitive for the command.
mvModelView matrix for the command.
flagsto indicate that the command is using 3D rendering or not.
local init ( local  globalOrder,
local  textureID,
local  glProgramState,
local  blendType,
local  primitive,
local  mv,
local  flags 
)

Initializes the command.

Parameters
globalOrderGlobalZOrder of the command.
textureIDThe openGL handle of the used texture.
glProgramStateThe specified glProgram and its uniform.
blendTypeBlend function for the command.
primitiveRendered primitive for the command.
mvModelView matrix for the command.
flagsto indicate that the command is using 3D rendering or not.
uint32_t getMaterialID ( ) const
inline

Get the generated material ID.

var getMaterialID ( )
inline

Get the generated material ID.

local getMaterialID ( )
inline

Get the generated material ID.

GLuint getTextureID ( ) const
inline

Get the texture ID used for drawing.

var getTextureID ( )
inline

Get the texture ID used for drawing.

local getTextureID ( )
inline

Get the texture ID used for drawing.

GLProgramState* getGLProgramState ( ) const
inline

Get the glprogramstate used for drawing.

var getGLProgramState ( )
inline

Get the glprogramstate used for drawing.

local getGLProgramState ( )
inline

Get the glprogramstate used for drawing.

BlendFunc getBlendType ( ) const
inline

Get the blend function for drawing.

var getBlendType ( )
inline

Get the blend function for drawing.

local getBlendType ( )
inline

Get the blend function for drawing.

const Mat4& getModelView ( ) const
inline

Get the modelview matrix when draw the primitive.

var getModelView ( )
inline

Get the modelview matrix when draw the primitive.

local getModelView ( )
inline

Get the modelview matrix when draw the primitive.

void execute ( ) const

Execute and draw the command, called by renderer.

var execute ( )

Execute and draw the command, called by renderer.

local execute ( )

Execute and draw the command, called by renderer.


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