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

VertexData is a class used for specify input streams for GPU rendering pipeline, a VertexData will be composed by several streams, every stream will contain a VertexStreamAttribute and the binding VertexBuffer. More...

Inherits Ref.

Public Member Functions

size_t getVertexStreamCount () const
 Get the number of streams in the VertexData.
 
bool setStream (VertexBuffer *buffer, const VertexStreamAttribute &stream)
 Set a stream to VertexData,given that stream is identified by semantic, so if the semantic is not specified before, it will add a stream, or it will override the old one. More...
 
void removeStream (int semantic)
 Remove the given streams. More...
 
const VertexStreamAttribute * getStreamAttribute (int semantic) const
 Get the attribute of stream, const version. More...
 
local getStreamAttribute ( local semantic)
 Get the attribute of stream, const version. More...
 
VertexStreamAttribute * getStreamAttribute (int semantic)
 Get the attribute of stream. More...
 
local getStreamAttribute ( local semantic)
 Get the attribute of stream. More...
 
VertexBuffer * getStreamBuffer (int semantic) const
 Get the binded buffer of the stream. More...
 
void use ()
 Called for rendering, it will bind the state of vertex data to current rendering pipeline.
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Ref * autorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Member Functions

static VertexData * create ()
 Create function, used to create a instance of VertexData.
 

Additional Inherited Members

- 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.
 

Detailed Description

VertexData is a class used for specify input streams for GPU rendering pipeline, a VertexData will be composed by several streams, every stream will contain a VertexStreamAttribute and the binding VertexBuffer.

Streams will be identified by semantic.

Member Function Documentation

bool setStream ( VertexBuffer *  buffer,
const VertexStreamAttribute &  stream 
)

Set a stream to VertexData,given that stream is identified by semantic, so if the semantic is not specified before, it will add a stream, or it will override the old one.

Parameters
bufferThe binding buffer of the stream.
streamThe binding vertex attribute, its member semantic will be used as the identifier.
local setStream ( local  buffer,
local  stream 
)

Set a stream to VertexData,given that stream is identified by semantic, so if the semantic is not specified before, it will add a stream, or it will override the old one.

Parameters
bufferThe binding buffer of the stream.
streamThe binding vertex attribute, its member semantic will be used as the identifier.
void removeStream ( int  semantic)

Remove the given streams.

Parameters
semanticThe semantic of the stream.
local removeStream ( local  semantic)

Remove the given streams.

Parameters
semanticThe semantic of the stream.
const VertexStreamAttribute*
getStreamAttribute
( int  semantic) const

Get the attribute of stream, const version.

Parameters
semanticThe semantic of the stream.
local getStreamAttribute ( local  semantic)

Get the attribute of stream, const version.

Parameters
semanticThe semantic of the stream.
VertexStreamAttribute*
getStreamAttribute
( int  semantic)

Get the attribute of stream.

Parameters
semanticThe semantic of the stream.
local getStreamAttribute ( local  semantic)

Get the attribute of stream.

Parameters
semanticThe semantic of the stream.
VertexBuffer* getStreamBuffer ( int  semantic) const

Get the binded buffer of the stream.

Parameters
semanticThe semantic of the stream.
local getStreamBuffer ( local  semantic)

Get the binded buffer of the stream.

Parameters
semanticThe semantic of the stream.

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