cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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...

#include <CCVertexIndexData.h>

Inheritance diagram for VertexData:
Ref

Classes

struct  BufferAttribute
 Simple struct to bundle buffer and attribute. More...
 

Public Member Functions

size_t getVertexStreamCount () const
 Get the number of streams in the VertexData. More...
 
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 VertexStreamAttributegetStreamAttribute (int semantic) const
 Get the attribute of stream, const version. More...
 
local getStreamAttribute ( local semantic)
 Get the attribute of stream, const version. More...
 
VertexStreamAttributegetStreamAttribute (int semantic)
 Get the attribute of stream. More...
 
local getStreamAttribute ( local semantic)
 Get the attribute of stream. More...
 
VertexBuffergetStreamBuffer (int semantic) const
 Get the binded buffer of the stream. More...
 
local getStreamBuffer ( local semantic)
 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. More...
 
- Public Member Functions inherited from Ref
void 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...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Member Functions

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

Protected Member Functions

 VertexData ()
 Constructor. More...
 
 VertexData ()
 Constructor. More...
 
virtual ~VertexData ()
 Destructor. More...
 
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Protected Attributes

std::map< int, BufferAttribute_vertexStreams
 Streams in the VertexData. More...
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

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.

Constructor & Destructor Documentation

VertexData ( )
protected

Constructor.

local VertexData ( )
protected

Constructor.

virtual ~VertexData ( )
protectedvirtual

Destructor.

local ~VertexData ( )
protectedvirtual

Destructor.

Member Function Documentation

static VertexData* create ( )
static

Create function, used to create a instance of VertexData.

local create ( )
static

Create function, used to create a instance of VertexData.

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.
size_t getVertexStreamCount ( ) const

Get the number of streams in the VertexData.

local getVertexStreamCount ( )

Get the number of streams in the VertexData.

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.
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 use ( )

Called for rendering, it will bind the state of vertex data to current rendering pipeline.

local use ( )

Called for rendering, it will bind the state of vertex data to current rendering pipeline.

Member Data Documentation

std::map<int, BufferAttribute>
_vertexStreams
protected

Streams in the VertexData.

local _vertexStreams
protected

Streams in the VertexData.


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