glGetVertexAttrib
Name
glGetVertexAttribdv, glGetVertexAttribfv, glGetVertexAttribiv Return a generic vertex attribute parameter
C Specification
void glGetVertexAttribdv(GLuint index,
GLenum pname,
GLdouble *params)
void glGetVertexAttribfv(GLuint index,
GLenum pname,
GLfloat *params)
void glGetVertexAttribiv(GLuint index,
GLenum pname,
GLint *params)
Parameters
index | Specifies the generic vertex attribute to be queried. | pname | Specifies the symbolic name of the vertex attribute parameter to be queried. GL_VERTEX_ATTRIB_ARRAY_ENABLED, GL_VERTEX_ATTRIB_ARRAY_SIZE, GL_VERTEX_ATTRIB_ARRAY_STRIDE, GL_VERTEX_ATTRIB_ARRAY_TYPE, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, GL_CURRENT_VERTEX_ATTRIB are accepted. | params | Returns the requested data. |
Description
glGetVertexAttrib returns in params the value of a generic vertex attribute parameter. The generic vertex attribute to be queried is specified by index, and the parameter to be queried is specified by pname.
The accepted parameter names are as follows:
GL_VERTEX_ATTRIB_ARRAY_ENABLED
params returns a single value that is non-zero (true) if the vertex attribute array for index is enabled and 0 (false) if it is disabled. The initial value is GL_FALSE.
GL_VERTEX_ATTRIB_ARRAY_SIZE
params returns a single value, the size of the vertex attribute array for index. The size is the number of values for each element of the vertex attribute array, and it is 1, 2, 3, or 4. The initial value is 4.
GL_VERTEX_ATTRIB_ARRAY_STRIDE
params returns a single value, the array stride for (number of bytes between successive elements in) the vertex attribute array for index. A value of 0 signifies that the array elements are stored sequentially in memory. The initial value is 0.
GL_VERTEX_ATTRIB_ARRAY_TYPE
params returns a single value, a symbolic constant indicating the array type for the vertex attribute array for index. Possible values are GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, and GL_DOUBLE. The initial value is GL_FLOAT.
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
params returns a single value that is non-zero (true) if fixed-point data types for the vertex attribute array indicated by index are normalized when they are converted to floating point, and 0 (false) otherwise. The initial value is GL_FALSE.
GL_CURRENT_VERTEX_ATTRIB
params returns four values that represent the current value for the generic vertex attribute specified by index. Generic vertex attribute 0 is unique in that it has no current state, so an error is generated if index is 0. The initial value for all other generic vertex attributes is (0,0,0,1).
All the parameters except GL_CURRENT_VERTEX_ATTRIB represent client-side state.
Notes
glGetVertexAttrib is available only if the GL version is 2.0 or greater.
If an error is generated, no change is made to the contents of params.
Errors
GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.
GL_INVALID_ENUM is generated if pname is not an accepted value.
GL_INVALID_OPERATION is generated if index is 0 and pname is GL_CURRENT_VERTEX_ATTRIB.
Associated Gets
glGet with argument GL_MAX_VERTEX_ATTRIBS
glGetVertexAttribPointer with arguments index and GL_VERTEX_ATTRIB_ARRAY_POINTER
See Also
glBindAttribLocation, glDisableVertexAttribArray, glEnableVertexAttribArray, glVertexAttrib, glVertexAttribPointer
|