glGetActiveUniform Function

Syntax

GL_APICALL void GL_APIENTRY glGetActiveUniform(
     GLuint program,
     GLuint index,
     GLsizei bufsize,
     GLsizei * length,
     GLint * size,
     GLenum * type,
     char * name
);

Arguments

Name Description
in program Program object
in index Uniform number
in bufsize Size of the buffer specified by name
out length Region storing the number of bytes in the string written to name
out size Region storing the uniform size
out type Region storing the uniform type
out name Array storing the uniform name

Return Values

No values are returned.

Description

Gets the active uniform's information.

Set program to the program object.

Set index to a value that is greater than or equal to 0 and is at least one less than the value obtained from glGetProgramiv with GL_ACTIVE_UNIFORMS specified.

Set bufsize to the size of the buffer specified in name.

The name, size (number of components), and data type of the active uniform specified by index in the object specified by program are stored in name, size, and type, respectively.

The length argument stores the size (in bytes) of the string saved in name. If the number of characters in the vertex attribute name exceeds bufsize, then bufsize-1 characters are copied into name and NULL is inserted at the end.

This function generates the following errors.

GL_INVALID_VALUEThe program or index argument was set to an invalid value, or bufsize was set to a negative value.
GL_INVALID_OPERATIONThe program argument is not linked correctly.

Revision History

2010/01/07
Initial version.

CONFIDENTIAL