Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Pass Class Reference

Material contains one or more techniques. More...

Inherits RenderState.

Public Member Functions

GLProgramStategetGLProgramState () const
 Gets the GLProgramState. More...
 
local getGLProgramState ()
 Gets the GLProgramState. More...
 
void bind (const Mat4 &modelView)
 Binds the GLProgramState and the RenderState. More...
 
void bind (const Mat4 &modelView, bool bindAttributes)
 Binds the GLProgramState and the RenderState. More...
 
var bind ( var modelView, var bindAttributes)
 Binds the GLProgramState and the RenderState. More...
 
local bind ( local modelView, local bindAttributes)
 Binds the GLProgramState and the RenderState. More...
 
void unbind ()
 Unbinds the Pass. More...
 
void setVertexAttribBinding (VertexAttribBinding *binding)
 Sets a vertex attribute binding for this pass. More...
 
VertexAttribBindinggetVertexAttributeBinding () const
 Returns the vertex attribute binding for this pass. More...
 
local getVertexAttributeBinding ()
 Returns the vertex attribute binding for this pass. More...
 
uint32_t getHash () const
 Get Hash code of the Pass. More...
 
Passclone () const
 Returns a clone (deep-copy) of this instance. More...
 
var clone ()
 Returns a clone (deep-copy) of this instance. More...
 
local clone ()
 Returns a clone (deep-copy) of this instance. More...
 
- Public Member Functions inherited from RenderState
std::string getName () const
 Get name Name.
 
void setTexture (Texture2D *texture)
 Texture that will use in the CC_Texture0 uniform. More...
 
Texture2DgetTexture () const
 Returns the texture that is going to be used for CC_Texture0. More...
 
void bind (Pass *pass)
 Binds the render state for this RenderState and any of its parents, top-down, for the given pass. More...
 
RenderStategetTopmost (RenderState *below)
 Returns the topmost RenderState in the hierarchy below the given RenderState. More...
 
var getTopmost ( var below)
 Returns the topmost RenderState in the hierarchy below the given RenderState. More...
 
local getTopmost ( local below)
 Returns the topmost RenderState in the hierarchy below the given RenderState. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Static Public Member Functions

static PasscreateWithGLProgramState (Technique *parent, GLProgramState *programState)
 Creates a Pass with a GLProgramState. More...
 
static Passcreate (Technique *parent)
 Creates a Pass. More...
 
local create ( local parent)
 Creates a Pass. More...
 
- Static Public Member Functions inherited from RenderState
static void initialize ()
 Static initializer that is called during game startup.
 
static void finalize ()
 Static finalizer that is called during game shutdown.
 

Additional Inherited Members

- Public Types inherited from RenderState
enum  DepthFunction
 Defines the supported depth compare functions. More...
 
enum  CullFaceSide
 Defines culling criteria for front-facing, back-facing and both-side facets.
 
enum  FrontFace
 Defines the winding of vertices in faces that are considered front facing. More...
 
enum  StencilFunction
 Defines the supported stencil compare functions. More...
 
enum  StencilOperation
 Defines the supported stencil operations to perform. More...
 
- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

Material contains one or more techniques.

Each technique can contains one or more passes. And material can active one technique for drawing. Pass contains vertex attribute binding and GLProgramState. The Passes in the same Technique are applied one by one when drawing an object.

Member Function Documentation

static Pass*
createWithGLProgramState
( Technique parent,
GLProgramState programState 
)
static

Creates a Pass with a GLProgramState.

Technique who owns this Pass. GLProgramState used to create Pass. Created Pass.

var createWithGLProgramState ( var  parent,
var  programState 
)
static

Creates a Pass with a GLProgramState.

Technique who owns this Pass. GLProgramState used to create Pass. Created Pass.

local createWithGLProgramState ( local  parent,
local  programState 
)
static

Creates a Pass with a GLProgramState.

Technique who owns this Pass. GLProgramState used to create Pass. Created Pass.

static Pass* create ( Technique parent)
static

Creates a Pass.

Technique who owns this Pass. Created Pass.

var create ( var  parent)
static

Creates a Pass.

Technique who owns this Pass. Created Pass.

local create ( local  parent)
static

Creates a Pass.

Technique who owns this Pass. Created Pass.

GLProgramState* getGLProgramState ( ) const

Gets the GLProgramState.

GLProgramState in the Pass.

var getGLProgramState ( )

Gets the GLProgramState.

GLProgramState in the Pass.

local getGLProgramState ( )

Gets the GLProgramState.

GLProgramState in the Pass.

void bind ( const Mat4 modelView)

Binds the GLProgramState and the RenderState.

This method must be called before call the actuall draw call. Model view matrix which is going to pass to shader.

var bind ( var  modelView)

Binds the GLProgramState and the RenderState.

This method must be called before call the actuall draw call. Model view matrix which is going to pass to shader.

local bind ( local  modelView)

Binds the GLProgramState and the RenderState.

This method must be called before call the actuall draw call. Model view matrix which is going to pass to shader.

void bind ( const Mat4 modelView,
bool  bindAttributes 
)

Binds the GLProgramState and the RenderState.

This method must be called before call the actuall draw call. Model view matrix which is going to pass to shader. binding vertex attribute ?

var bind ( var  modelView,
var  bindAttributes 
)

Binds the GLProgramState and the RenderState.

This method must be called before call the actuall draw call. Model view matrix which is going to pass to shader. binding vertex attribute ?

local bind ( local  modelView,
local  bindAttributes 
)

Binds the GLProgramState and the RenderState.

This method must be called before call the actuall draw call. Model view matrix which is going to pass to shader. binding vertex attribute ?

void unbind ( )

Unbinds the Pass.

This method must be called AFTER calling the actuall draw call.

var unbind ( )

Unbinds the Pass.

This method must be called AFTER calling the actuall draw call.

local unbind ( )

Unbinds the Pass.

This method must be called AFTER calling the actuall draw call.

void setVertexAttribBinding ( VertexAttribBinding binding)

Sets a vertex attribute binding for this pass.

When a mesh binding is set, the VertexAttribBinding will be automatically bound when the bind() method is called for the pass. The VertexAttribBinding to set (or NULL to remove an existing binding).

var setVertexAttribBinding ( var  binding)

Sets a vertex attribute binding for this pass.

When a mesh binding is set, the VertexAttribBinding will be automatically bound when the bind() method is called for the pass. The VertexAttribBinding to set (or NULL to remove an existing binding).

local setVertexAttribBinding ( local  binding)

Sets a vertex attribute binding for this pass.

When a mesh binding is set, the VertexAttribBinding will be automatically bound when the bind() method is called for the pass. The VertexAttribBinding to set (or NULL to remove an existing binding).

VertexAttribBinding*
getVertexAttributeBinding
( ) const

Returns the vertex attribute binding for this pass.

The vertex attribute binding for this pass.

var getVertexAttributeBinding ( )

Returns the vertex attribute binding for this pass.

The vertex attribute binding for this pass.

local getVertexAttributeBinding ( )

Returns the vertex attribute binding for this pass.

The vertex attribute binding for this pass.

uint32_t getHash ( ) const

Get Hash code of the Pass.

Hash code of this pass.

var getHash ( )

Get Hash code of the Pass.

Hash code of this pass.

local getHash ( )

Get Hash code of the Pass.

Hash code of this pass.

Pass* clone ( ) const

Returns a clone (deep-copy) of this instance.

Copy of this pass.

var clone ( )

Returns a clone (deep-copy) of this instance.

Copy of this pass.

local clone ( )

Returns a clone (deep-copy) of this instance.

Copy of this pass.


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