Gawain: add immUniform4iv

Needed soon by OCIO.
This commit is contained in:
Mike Erwin 2017-04-12 18:20:58 -04:00
parent c61b7b0263
commit 6bfb9b7b5f
2 changed files with 11 additions and 0 deletions

View File

@ -79,6 +79,7 @@ void immVertex2iv(unsigned attrib_id, const int data[2]);
// provide uniform values that don't change for the entire draw call
void immUniform1i(const char* name, int x);
void immUniform4iv(const char* name, const int data[4]);
void immUniform1f(const char* name, float x);
void immUniform2f(const char* name, float x, float y);
void immUniform2fv(const char* name, const float data[2]);

View File

@ -827,6 +827,16 @@ void immUniform1i(const char* name, int x)
glUniform1i(loc, x);
}
void immUniform4iv(const char* name, const int data[4])
{
int loc = glGetUniformLocation(imm.bound_program, name);
#if TRUST_NO_ONE
assert(loc != -1);
#endif
glUniform4iv(loc, 1, data);
}
// --- convenience functions for setting "uniform vec4 color" ---