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

Command used to draw batches in one TextureAtlas. More...

#include <CCBatchCommand.h>

Inheritance diagram for BatchCommand:
RenderCommand

Public Member Functions

 BatchCommand ()
 Constructor. More...
 
 ~BatchCommand ()
 Destructor. More...
 
void init (float globalZOrder, GLProgram *shader, BlendFunc blendType, TextureAtlas *textureAtlas, const Mat4 &modelViewTransform, uint32_t flags)
 Init the batch command. More...
 
local init ( local globalZOrder, local shader, local blendType, local textureAtlas, local modelViewTransform, local flags)
 Init the batch command. More...
 
void init (float depth, GLProgram *shader, BlendFunc blendType, TextureAtlas *textureAtlas, const Mat4 &modelViewTransform)
void execute ()
 Execute the command, which will call openGL function to draw the texture atlas. More...
 
- 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...
 
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 Attributes

int32_t _materialID
GLuint _textureID
 Texture ID used for texture atlas rendering. More...
 
GLProgram_shader
 Shaders used for rendering. More...
 
BlendFunc _blendType
 Blend function for rendering. More...
 
TextureAtlas_textureAtlas
 Texture atlas for rendering. More...
 
Mat4 _mv
 ModelView transform. More...
 
- Protected Attributes inherited from RenderCommand
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...
 

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...
 
- Protected Member Functions inherited from RenderCommand
 RenderCommand ()
 Constructor. More...
 
virtual ~RenderCommand ()
 Desctructor. More...
 
local ~RenderCommand ()
 Desctructor. More...
 
void printID ()

Detailed Description

Command used to draw batches in one TextureAtlas.

Constructor & Destructor Documentation

Constructor.

var BatchCommand ( )

Constructor.

local BatchCommand ( )

Constructor.

Destructor.

var ~BatchCommand ( )

Destructor.

local ~BatchCommand ( )

Destructor.

Member Function Documentation

void execute ( )

Execute the command, which will call openGL function to draw the texture atlas.

var execute ( )

Execute the command, which will call openGL function to draw the texture atlas.

local execute ( )

Execute the command, which will call openGL function to draw the texture atlas.

void init ( float  globalZOrder,
GLProgram shader,
BlendFunc  blendType,
TextureAtlas textureAtlas,
const Mat4 modelViewTransform,
uint32_t  flags 
)

Init the batch command.

Parameters
globalZOrderGlobalZOrder of the render command.
shaderShader used for draw the texture atlas.
blendTypeBlend function for texture atlas.
textureAtlasTexture atlas, will contain both quads and texture for rendering.
modelViewTransformModel view transform used for rendering.
flagsIndicate the render command should be rendered in 3D mode or not.
var init ( var  globalZOrder,
var  shader,
var  blendType,
var  textureAtlas,
var  modelViewTransform,
var  flags 
)

Init the batch command.

Parameters
globalZOrderGlobalZOrder of the render command.
shaderShader used for draw the texture atlas.
blendTypeBlend function for texture atlas.
textureAtlasTexture atlas, will contain both quads and texture for rendering.
modelViewTransformModel view transform used for rendering.
flagsIndicate the render command should be rendered in 3D mode or not.
local init ( local  globalZOrder,
local  shader,
local  blendType,
local  textureAtlas,
local  modelViewTransform,
local  flags 
)

Init the batch command.

Parameters
globalZOrderGlobalZOrder of the render command.
shaderShader used for draw the texture atlas.
blendTypeBlend function for texture atlas.
textureAtlasTexture atlas, will contain both quads and texture for rendering.
modelViewTransformModel view transform used for rendering.
flagsIndicate the render command should be rendered in 3D mode or not.
void init ( float  depth,
GLProgram shader,
BlendFunc  blendType,
TextureAtlas textureAtlas,
const Mat4 modelViewTransform 
)
var init ( var  depth,
var  shader,
var  blendType,
var  textureAtlas,
var  modelViewTransform 
)
local init ( local  depth,
local  shader,
local  blendType,
local  textureAtlas,
local  modelViewTransform 
)

Member Data Documentation

BlendFunc _blendType
protected

Blend function for rendering.

var _blendType
protected

Blend function for rendering.

local _blendType
protected

Blend function for rendering.

int32_t _materialID
protected
Mat4 _mv
protected

ModelView transform.

var _mv
protected

ModelView transform.

local _mv
protected

ModelView transform.

GLProgram* _shader
protected

Shaders used for rendering.

var _shader
protected

Shaders used for rendering.

local _shader
protected

Shaders used for rendering.

TextureAtlas* _textureAtlas
protected

Texture atlas for rendering.

var _textureAtlas
protected

Texture atlas for rendering.

local _textureAtlas
protected

Texture atlas for rendering.

GLuint _textureID
protected

Texture ID used for texture atlas rendering.

var _textureID
protected

Texture ID used for texture atlas rendering.

local _textureID
protected

Texture ID used for texture atlas rendering.


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