Cocos2d-x
4.0.0
|
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. | |
![]() | |
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 Triangles & | getTriangles () 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_T2F * | getVertices () const |
Get the vertex data pointer. | |
const unsigned short * | getIndices () const |
Get the index data pointer. | |
const Mat4 & | getModelView () const |
Get the model view matrix. | |
void | updateMaterialID () |
update material ID | |
![]() | |
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 | |
![]() | |
enum | Type { UNKNOWN_COMMAND, QUAD_COMMAND, CUSTOM_COMMAND, GROUP_COMMAND, MESH_COMMAND, TRIANGLES_COMMAND, CALLBACK_COMMAND } |
Enum the type of render command. More... | |
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.
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.
globalOrder | GlobalZOrder of the command. |
texture | The texture used in the command. |
blendType | Blend function for the command. |
quads | Rendered quads for the command. |
quadCount | The number of quads when rendering. |
mv | ModelView matrix for the command. |
flags | to indicate that the command is using 3D rendering or not. |