glGetUniformfv Function

Syntax

GL_APICALL void GL_APIENTRY glGetUniformfv(
     GLuint program,
     GLint location,
     GLfloat * params
);

Arguments

Name Description
in program Program object.
in location Location of uniform variable.
out params Array storing the obtained values.

Return Values

There is no return value.

Description

Gets uniform values as floating-point numbers.

program specifies the program object. location specifies the uniform variable's location. Data is obtained in the array specified by params.

The number of elements obtained in params varies with the uniform type. There is one element for GL_FLOAT, two elements for GL_FLOAT_VEC2, three elements for GL_FLOAT_VEC3, and four elements for GL_FLOAT_VEC4. The matrix types GL_FLOAT_MAT2, GL_FLOAT_MAT3, and GL_FLOAT_MAT4 are treated as arrays with two GL_FLOAT_VEC2 values, three GL_FLOAT_VEC3 values, and four GL_FLOAT_VEC4 values, respectively. This function can only get a single array element from uniform variable arrays. To specify the element to get, add its offset in the array to location. The location obtained by glGetUniformLocation specifies the first element in the array. Add i to location to specify the (i+1) element. (A "uniform variable array" is a uniform variable that pragma bind_symbol has bound to multiple registers in a vertex shader. It is not a uniform variable that has been bound to multiple components of a single register. )

The following errors occur in this function.

GL_INVALID_VALUEThe program argument was set to an invalid value.
GL_INVALID_OPERATIONEither program is not the current program or it has not been linked properly.
GL_INVALID_OPERATIONThe location argument was set to an invalid value.

Revision History

2010/01/07
Initial version.

CONFIDENTIAL