Cocos2d-x  4.0.0
Public Member Functions | List of all members
VertexLayout Class Reference

Store vertex attribute layout. More...

Public Member Functions

void setAttribute (const std::string &name, std::size_t index, VertexFormat format, std::size_t offset, bool needToBeNormallized)
 Set attribute values to name.
 
void setLayout (std::size_t stride)
 Set stride of vertices.
 
std::size_t getStride () const
 Get the distance between the data of two vertices, in bytes.
 
VertexStepMode getVertexStepMode () const
 Get vertex step function.
 
const std::unordered_map
< std::string, Attribute > & 
getAttributes () const
 Get attribute informations.
 
bool isValid () const
 Check if vertex layout has been set.
 

Detailed Description

Store vertex attribute layout.

Member Function Documentation

void setAttribute ( const std::string &  name,
std::size_t  index,
VertexFormat  format,
std::size_t  offset,
bool  needToBeNormallized 
)

Set attribute values to name.

Parameters
nameSpecifies the attribute name.
indexSpecifies the index of the generic vertex attribute to be modified.
formatSpecifies how the vertex attribute data is laid out in memory.
offsetSpecifies the byte offset to the first component of the first generic vertex attribute.
needToBeNormallizedSpecifies whether fixed-point data values should be normalized (true) or converted directly as fixed-point values (false) when they are accessed.
void setLayout ( std::size_t  stride)

Set stride of vertices.

Parameters
strideSpecifies the distance between the data of two vertices, in bytes.
std::size_t getStride ( ) const
inline

Get the distance between the data of two vertices, in bytes.

Returns
The distance between the data of two vertices, in bytes.
VertexStepMode getVertexStepMode ( ) const
inline

Get vertex step function.

Default value is VERTEX.

Returns
Vertex step function.
Note
Used in metal.
const std::unordered_map<std::string, Attribute>& getAttributes ( ) const
inline

Get attribute informations.

Returns
Atrribute informations.

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