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

VertexStreamAttribute is used to specify the vertex attribute for drawing, which is correspondent to glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr). More...

#include <CCVertexIndexData.h>

Public Member Functions

 VertexStreamAttribute ()
 Constructor. More...
 
 VertexStreamAttribute (int offset, int semantic, int type, int size)
 Constructor. More...
 
 VertexStreamAttribute ( var offset, var semantic, var type, var size)
 Constructor. More...
 
 VertexStreamAttribute ( local offset, local semantic, local type, local size)
 Constructor. More...
 
 VertexStreamAttribute (int offset, int semantic, int type, int size, bool normalize)
 Constructor. More...
 

Public Attributes

bool _normalize
 Whether the attribute should be normalized or not. More...
 
int _offset
 The offset of the attribute in the buffer. More...
 
int _semantic
 Describe that the attribute usage, could be Position, Color etc. More...
 
int _type
 Describe the type of attribute, could be GL_FLOAT, GL_UNSIGNED_BYTE etc. More...
 
int _size
 Describe how many elements of type in the attribute. More...
 

Detailed Description

VertexStreamAttribute is used to specify the vertex attribute for drawing, which is correspondent to glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr).

_semantic -> index _size -> size _type -> type _normalize -> normalized _offset is used to compute the start offset in a interleaved array, take a V3F_C4B_T2F array, offset of vertex will be 0, offset of color would be 0 + sizeof(float) * 3 = 12, offset of texture coord would be 12 + sizeof(char) * 4 = 16.

Constructor & Destructor Documentation

Constructor.

var VertexStreamAttribute ( )
inline

Constructor.

local VertexStreamAttribute ( )
inline

Constructor.

VertexStreamAttribute ( int  offset,
int  semantic,
int  type,
int  size 
)
inline

Constructor.

Parameters
offsetThe offset of the attribute.
semanticThe semantic (Position, Texcoord, Color etc) of attribute.
typeThe type of attribute, could be GL_FLOAT, GL_UNSIGNED_BYTE etc.
sizeDescribe how many elements of type in the attribute.
var VertexStreamAttribute ( var  offset,
var  semantic,
var  type,
var  size 
)
inline

Constructor.

Parameters
offsetThe offset of the attribute.
semanticThe semantic (Position, Texcoord, Color etc) of attribute.
typeThe type of attribute, could be GL_FLOAT, GL_UNSIGNED_BYTE etc.
sizeDescribe how many elements of type in the attribute.
local VertexStreamAttribute ( local  offset,
local  semantic,
local  type,
local  size 
)
inline

Constructor.

Parameters
offsetThe offset of the attribute.
semanticThe semantic (Position, Texcoord, Color etc) of attribute.
typeThe type of attribute, could be GL_FLOAT, GL_UNSIGNED_BYTE etc.
sizeDescribe how many elements of type in the attribute.
VertexStreamAttribute ( int  offset,
int  semantic,
int  type,
int  size,
bool  normalize 
)
inline

Constructor.

Parameters
offsetThe offset of the attribute.
semanticThe semantic (Position, Texcoord, Color etc) of attribute.
typeThe type of attribute, could be GL_FLOAT, GL_UNSIGNED_BYTE etc.
sizeDescribe how many elements of type in the attribute.
normalizeIf true, the data will be normalized by deviding 255.
var VertexStreamAttribute ( var  offset,
var  semantic,
var  type,
var  size,
var  normalize 
)
inline

Constructor.

Parameters
offsetThe offset of the attribute.
semanticThe semantic (Position, Texcoord, Color etc) of attribute.
typeThe type of attribute, could be GL_FLOAT, GL_UNSIGNED_BYTE etc.
sizeDescribe how many elements of type in the attribute.
normalizeIf true, the data will be normalized by deviding 255.
local VertexStreamAttribute ( local  offset,
local  semantic,
local  type,
local  size,
local  normalize 
)
inline

Constructor.

Parameters
offsetThe offset of the attribute.
semanticThe semantic (Position, Texcoord, Color etc) of attribute.
typeThe type of attribute, could be GL_FLOAT, GL_UNSIGNED_BYTE etc.
sizeDescribe how many elements of type in the attribute.
normalizeIf true, the data will be normalized by deviding 255.

Member Data Documentation

bool _normalize

Whether the attribute should be normalized or not.

int _offset

The offset of the attribute in the buffer.

var _offset

The offset of the attribute in the buffer.

local _offset

The offset of the attribute in the buffer.

int _semantic

Describe that the attribute usage, could be Position, Color etc.

var _semantic

Describe that the attribute usage, could be Position, Color etc.

local _semantic

Describe that the attribute usage, could be Position, Color etc.

int _size

Describe how many elements of type in the attribute.

var _size

Describe how many elements of type in the attribute.

local _size

Describe how many elements of type in the attribute.

int _type

Describe the type of attribute, could be GL_FLOAT, GL_UNSIGNED_BYTE etc.

var _type

Describe the type of attribute, could be GL_FLOAT, GL_UNSIGNED_BYTE etc.

local _type

Describe the type of attribute, could be GL_FLOAT, GL_UNSIGNED_BYTE etc.


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