glGetUniformLocation

Returns the location of a uniform variable

Signature

glGetUniformLocation( GLuint ( program ) , const GLchar *( name ) )-> GLint
glGetUniformLocation( program , name ) -> <class 'ctypes.c_int'>
Check that name is a string with a null byte at the end of it

Parameters

VariablesDescription
program
Specifies the program object to be queried.
name
Points to a null terminated string containing the name of the uniform variable whose location is to be queried.

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glGetUniformLocation
OpenGLContext tests/shader_8.py Lines: 170, 174
OpenGLContext tests/shader_10.py Lines: 227, 231
OpenGLContext tests/shader_9.py Lines: 293, 297
OpenGLContext tests/shader_3.py Lines: 132, 133
OpenGLContext tests/shader_6.py Lines: 221
OpenGLContext tests/shader_11.py Lines: 239
OpenGLContext tests/shader_5.py Lines: 271
OpenGLContext tests/shaders.py Lines: 71
OpenGLContext tests/shader_7.py Lines: 220, 229
OpenGLContext tests/pygame_textureatlas.py Lines: 71, 72
OpenGLContext tests/shader_4.py Lines: 104
OpenGLContext OpenGLContext/scenegraph/shaders.py Lines: 536
{LGPL} PyMT pymt/graphx/shader.py Lines: 10, 61, 65
{GPL3} OpenGL-Programmable 06-perpixel.py Lines: 103
{GPL3} OpenGL-Programmable 09-gles2.py Lines: 126
{GPL3} OpenGL-Programmable 10-gl3.2core.py Lines: 134
{GPL3} OpenGL-Programmable 08-pbo.py Lines: 112
{GPL3} OpenGL-Programmable 05-shader.py Lines: 95
{GPL3} OpenGL-Programmable 07-attrib.py Lines: 112