Graphics Reference
In-Depth Information
serve as the basis for vertex buffer objects that provide an efficient and
flexible way for specifying vertex attribute data. Vertex arrays are specified
using the
glVertexAttribPointer
or
glVertexAttribIPointer
function.
void
glVertexAttribPointer
(GLuint
index
, GLint
size
,
GLenum
type
,
GLboolean
normalized
,
GLsizei
stride
,
const void *
ptr
)
void
glVertexAttribIPointer
(GLuint
index
, GLint
size
,
GLenum
type
,
GLsizei
stride
,
const void *
ptr
)
specifies the generic vertex attribute index. This value can
range from 0 to the maximum vertex attributes supported
minus 1.
index
number of components specified in the vertex array for
the vertex attribute referenced by the index. Valid values
are 1-4.
size
data format. Valid values for both functions are
GL_BYTE
GL_UNSIGNED_BYTE
GL_SHORT
GL_UNSIGNED_SHORT
GL_INT
GL_UNSIGNED_INT
Valid values for
glVertexAttribPointer
also include
GL_HALF_FLOAT
GL_FLOAT
GL_FIXED
GL_INT_2_10_10_10_REV
GL_UNSIGNED_INT_2_10_10_10_REV
type
(
glVertexAttribPointer
only) is used to indicate
whether the non-floating data format type should be
normalized when converted to floating-point values. For
glVertexAttribIPointer
, the values are treated as integers.
normalized
the components of vertex attribute specified by size are
stored sequentially for each vertex.
stride
specifies the
delta between data for vertex index I and vertex (I + 1).
If
stride
is 0, attribute data for all vertices are stored
(continues)
stride