GLGETACTIVEATTRIB(3gl)GLGETACTIVEATTRIB(3gl)NAMEglGetActiveAttribARB - returns information about active vertex
attribute
C SPECIFICATION
void glGetActiveAttribARB( GLhandleARB program,
GLuint index,
GLsizei maxLength,
GLsizei *length,
GLint *size,
GLenum *type,
GLcharARB *name )
PARAMETERS
program Specifies the handle of program object to be queried.
index Specifies the index of the vertex attribute to be queried.
maxLength Specifies the maximum number of characters that OpenGL can
write
into
name
length Returns number of characters written into name.
size Returns size of the attribute variable.
type Returns the type of the attribute variable.
name Returns string containing the name of the attribute
vari‐
able.
DESCRIPTIONglGetActiveAttribARB returns information about an active vertex
attribute variable in the program object specified by program. An
index of 0 selects the first active attribute and an index of
GL_OBJECT_ACTIVE_ATTRIBUTES_ARB-1 selects the last active attribute.
The value of GL_OBJECT_ACTIVE_ATTRIBUTES_ARB can be queried with glGe‐
tObjectParametervARB.
The parameter program is a handle to a program object which has been
passed to glLinkProgramARB. It is not necessary for program to have
been linked successfully. The link could have failed because the number
of active attributes exceeded the limit.
The attribute name is returned into the string name and is null termi‐
nated. The maximum number of characters that can be written into name
is controlled by maxLength. The actual number of characters written
into name (excluding the null terminator) is returned in length. If
length is NULL no value is written into length. The length of the
longest attribute name in program can be queried with glGetObjectParam‐
etervARB with the parameter GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB.
The returned attribute name can also be the name of a built-in
attribute state variable.
The type of the attribute is returned in type. The size of the
attribute is returned in size. The value in size is in the units of the
type returned in type. The type returned can be any of GL_FLOAT,
GL_FLOAT_VEC2_ARB, GL_FLOAT_VEC3_ARB, GL_FLOAT_VEC4_ARB, GL_INT,
GL_INT_VEC2_ARB, GL_INT_VEC3_ARB, GL_INT_VEC4_ARB, GL_BOOL_ARB,
GL_BOOL_VEC2_ARB, GL_BOOL_VEC3_ARB, GL_BOOL_VEC4_ARB,
GL_FLOAT_MAT2_ARB, GL_FLOAT_MAT3_ARB, or GL_FLOAT_MAT4_ARB.
glGetActiveAttributeARB returns as much information about active
attributes as possible. If no information is available, length will be
set to zero and name will be an empty string. This situation can happen
when the link was unsuccessful.
ERRORS
GL_INVALID_VALUE is generated if program is not a valid object handle.
GL_INVALID_OPERATION is generated if program is not of type GL_PRO‐
GRAM_OBJECT_ARB.
GL_INVALID_VALUE is generated if index is greater than or equal to
GL_OBJECT_ACTIVE_ATTRIBUTES_ARB.
GL_INVALID_OPERATION is generated glGetActiveAttribARB is executed
between glBegin and glEnd.
SEE ALSO
glBindAttribLocationARB, glLinkProgramARB, glVertexAttribARB, glVertex‐
AttribPointerARB
11 Mar 04 GLGETACTIVEATTRIB(3gl)