add guGetUniformLocationsArray()
This commit is contained in:
parent
ec9af1b8b1
commit
eb0530004d
10
glslUtil.c
10
glslUtil.c
@ -347,3 +347,13 @@ void guGetUniformLocations(GLuint program, guUniformLocation *locs)
|
||||
*locs[i].loc = glGetUniformLocation(program, locs[i].name);
|
||||
}
|
||||
}
|
||||
|
||||
void guGetUniformLocationsArray(GLuint program, const char **names,
|
||||
GLint *locations)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; names[i] != NULL; i++)
|
||||
{
|
||||
locations[i] = glGetUniformLocation(program, names[i]);
|
||||
}
|
||||
}
|
||||
|
13
glslUtil.h
13
glslUtil.h
@ -234,6 +234,19 @@ GLuint guMakeProgram(GLuint v_shader_id, GLuint f_shader_id,
|
||||
*/
|
||||
void guGetUniformLocations(GLuint program, guUniformLocation *locs);
|
||||
|
||||
/**
|
||||
* Get the locations of uniform variables in an OpenGL program object.
|
||||
* This function stores the locations found into an array of GLints.
|
||||
* @param program the OpenGL program object
|
||||
* @param names pointer to a NULL-terminated array of uniform names
|
||||
* @param locations pointer to an array of GLints to store the locations in
|
||||
*
|
||||
* locations should point to an array with as many elements as names
|
||||
* points to (minus the terminating NULL element).
|
||||
*/
|
||||
void guGetUniformLocationsArray(GLuint program, const char **names,
|
||||
GLint *locations);
|
||||
|
||||
/**
|
||||
* Create an OpenGL buffer object containing contents from memory.
|
||||
* @param target the OpenGL buffer target (ex: GL_ARRAY_BUFFER).
|
||||
|
Loading…
x
Reference in New Issue
Block a user