glGetUniformiv Function
GL_APICALL void GL_APIENTRY glGetUniformiv(
GLuint program,
GLint location,
GLint * params
);
| Name | Description | |
|---|---|---|
| in | program | Program object. |
| in | location | Location of uniform variable. |
| out | params | Array storing the obtained values. |
Gets values for uniforms that use a data type other than 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 are two elements for GL_BOOL_VEC2 and GL_INT_VEC2, three elements for GL_BOOL_VEC3 and GL_INT_VEC3, and four elements for GL_BOOL_VEC4 and GL_INT_VEC4. In all other cases there is one element. 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_VALUE | The program argument was set to an invalid value. |
|---|---|
GL_INVALID_OPERATION | Either program is not the current program or it has not been linked properly. |
GL_INVALID_OPERATION | The location argument was set to an invalid value. |
CONFIDENTIAL