add guGetUniformLocations()
This commit is contained in:
parent
50789dee61
commit
4891db44de
@ -338,3 +338,12 @@ GLuint guMakeProgram(GLuint v_shader_id, GLuint f_shader_id,
|
||||
|
||||
return program;
|
||||
}
|
||||
|
||||
void guGetUniformLocations(GLuint program, guUniformLocation *locs)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; locs[i].name != NULL; i++)
|
||||
{
|
||||
*locs[i].loc = glGetUniformLocation(program, locs[i].name);
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,10 @@ typedef struct {
|
||||
GLuint index;
|
||||
const char *name;
|
||||
} guAttribBinding;
|
||||
typedef struct {
|
||||
GLint *loc;
|
||||
const char *name;
|
||||
} guUniformLocation;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -49,6 +53,8 @@ GLuint guMakeProgramFromFiles(const char *v_shader, const char *f_shader,
|
||||
GLuint guMakeProgram(GLuint v_shader_id, GLuint f_shader_id,
|
||||
const guAttribBinding *bindings);
|
||||
|
||||
void guGetUniformLocations(GLuint program, guUniformLocation *locs);
|
||||
|
||||
GLuint guMakeBuffer(GLenum target, GLenum usage, const void *ptr, size_t sz);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
x
Reference in New Issue
Block a user