Cocos2d-x  4.0.0
Public Member Functions | List of all members
QuadCommand Class Reference

Command used to render one or more Quads, similar to TrianglesCommand. More...

Inherits TrianglesCommand.

Public Member Functions

 QuadCommand ()
 Constructor.
 
 ~QuadCommand ()
 Destructor.
 
void init (float globalOrder, Texture2D *texture, const BlendFunc &blendType, V3F_C4B_T2F_Quad *quads, ssize_t quadCount, const Mat4 &mv, uint32_t flags)
 Initializes the command.
 
- Public Member Functions inherited from TrianglesCommand
 TrianglesCommand ()
 Constructor.
 
 ~TrianglesCommand ()
 Destructor.
 
void init (float globalOrder, cocos2d::Texture2D *texture, const BlendFunc &blendType, const Triangles &triangles, const Mat4 &mv, uint32_t flags)
 Initializes the command.
 
uint32_t getMaterialID () const
 Get the material id of command.
 
const TrianglesgetTriangles () const
 Get a const reference of triangles.
 
size_t getVertexCount () const
 Get the vertex count in the triangles.
 
size_t getIndexCount () const
 Get the index count of the triangles.
 
const V3F_C4B_T2FgetVertices () const
 Get the vertex data pointer.
 
const unsigned short * getIndices () const
 Get the index data pointer.
 
const Mat4getModelView () const
 Get the model view matrix.
 
void updateMaterialID ()
 update material ID
 
- Public Member Functions inherited from RenderCommand
void init (float globalZOrder, const Mat4 &modelViewTransform, unsigned int flags)
 Init function, will be called by all the render commands.
 
float getGlobalOrder () const
 Get global Z order.
 
Type getType () const
 Returns the Command type.
 
bool isTransparent () const
 Returns whether is transparent.
 
void setTransparent (bool isTransparent)
 Set transparent flag.
 
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.
 
bool is3D () const
 Whether the command should be rendered at 3D mode.
 
void set3D (bool value)
 Set the command rendered in 3D mode or not.
 
float getDepth () const
 Get the depth by current model view matrix.
 
PipelineDescriptor & getPipelineDescriptor ()
 Can use the result to change the descriptor content.
 

Additional Inherited Members

- Public Types inherited from RenderCommand
enum  Type {
  UNKNOWN_COMMAND, QUAD_COMMAND, CUSTOM_COMMAND, GROUP_COMMAND,
  MESH_COMMAND, TRIANGLES_COMMAND, CALLBACK_COMMAND
}
 Enum the type of render command. More...
 

Detailed Description

Command used to render one or more Quads, similar to TrianglesCommand.

Every QuadCommand will have generate material ID by give textureID, glProgramState, Blend function if the material id is the same, these QuadCommands could be batched to save draw call.

Constructor & Destructor Documentation

Constructor.

Destructor.

Member Function Documentation

void init ( float  globalOrder,
Texture2D texture,
const BlendFunc blendType,
V3F_C4B_T2F_Quad quads,
ssize_t  quadCount,
const Mat4 mv,
uint32_t  flags 
)

Initializes the command.

Parameters
globalOrderGlobalZOrder of the command.
textureThe texture used in the command.
blendTypeBlend function for the command.
quadsRendered quads for the command.
quadCountThe number of quads when rendering.
mvModelView matrix for the command.
flagsto indicate that the command is using 3D rendering or not.

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