glGetUniformLocation Function
GL_APICALL int GL_APIENTRY glGetUniformLocation(
GLuint program,
const char * name
);
| Name | Description | |
|---|---|---|
| in | program | Program object |
| in | name | Name of uniform variable |
Gets the location of a uniform variable.
The location is used to get and set the uniform variable's values. Set program to the program object. Set name to the name of the uniform variable whose location is to be obtained. If the uniform variable specified by name is found in the program, its location is returned. If it is not found or an error occurs, a value of -1 is returned.
To specify the element to access in a uniform variable array, add an offset to the obtained location. If you add i to the location, it is handled as the location of the (i+1)th element of the uniform variable array.
This function generates the following errors.
| GL_INVALID_VALUE | The program argument was set to an invalid value. |
|---|---|
| GL_INVALID_OPERATION | The program argument is not linked correctly. |
CONFIDENTIAL