Complete immUniform functions to support 2float and 3float

This commit is contained in:
Antonio Vazquez 2017-02-10 17:28:40 +01:00
parent 26f8095384
commit f9329997c3
2 changed files with 48 additions and 0 deletions

View File

@ -727,6 +727,50 @@ void immUniform1f(const char* name, float x)
glUniform1f(loc, x);
}
void immUniform2f(const char* name, float x, float y)
{
int loc = glGetUniformLocation(imm.bound_program, name);
#if TRUST_NO_ONE
assert(loc != -1);
#endif
glUniform2f(loc, x, y);
}
void immUniform2fv(const char* name, const float data[2])
{
int loc = glGetUniformLocation(imm.bound_program, name);
#if TRUST_NO_ONE
assert(loc != -1);
#endif
glUniform2fv(loc, 1, data);
}
void immUniform3f(const char* name, float x, float y, float z)
{
int loc = glGetUniformLocation(imm.bound_program, name);
#if TRUST_NO_ONE
assert(loc != -1);
#endif
glUniform3f(loc, x, y, z);
}
void immUniform3fv(const char* name, const float data[3])
{
int loc = glGetUniformLocation(imm.bound_program, name);
#if TRUST_NO_ONE
assert(loc != -1);
#endif
glUniform3fv(loc, 1, data);
}
void immUniform4f(const char* name, float x, float y, float z, float w)
{
int loc = glGetUniformLocation(imm.bound_program, name);

View File

@ -79,6 +79,10 @@ 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 immUniform1f(const char* name, float x);
void immUniform2f(const char* name, float x, float y);
void immUniform2fv(const char* name, const float data[2]);
void immUniform3f(const char* name, float x, float y, float z);
void immUniform3fv(const char* name, const float data[3]);
void immUniform4f(const char* name, float x, float y, float z, float w);
void immUniform4fv(const char* name, const float data[4]);