Clay Engine: Added immUniform functions...
for vec3 arrays and matrix4.
This commit is contained in:
@@ -771,6 +771,18 @@ void immUniform3fv(const char* name, const float data[3])
|
||||
glUniform3fv(loc, 1, data);
|
||||
}
|
||||
|
||||
void immUniformArray3fv(const char* name, const float *data, int count)
|
||||
{
|
||||
int loc = glGetUniformLocation(imm.bound_program, name);
|
||||
|
||||
#if TRUST_NO_ONE
|
||||
assert(loc != -1);
|
||||
assert(count > 0);
|
||||
#endif
|
||||
|
||||
glUniform3fv(loc, count, data);
|
||||
}
|
||||
|
||||
void immUniform4f(const char* name, float x, float y, float z, float w)
|
||||
{
|
||||
int loc = glGetUniformLocation(imm.bound_program, name);
|
||||
@@ -793,6 +805,17 @@ void immUniform4fv(const char* name, const float data[4])
|
||||
glUniform4fv(loc, 1, data);
|
||||
}
|
||||
|
||||
void immUniformMatrix4fv(const char* name, const float data[4][4])
|
||||
{
|
||||
int loc = glGetUniformLocation(imm.bound_program, name);
|
||||
|
||||
#if TRUST_NO_ONE
|
||||
assert(loc != -1);
|
||||
#endif
|
||||
|
||||
glUniformMatrix4fv(loc, 1, GL_FALSE, (float *)data);
|
||||
}
|
||||
|
||||
void immUniform1i(const char* name, int x)
|
||||
{
|
||||
int loc = glGetUniformLocation(imm.bound_program, name);
|
||||
|
||||
@@ -83,8 +83,10 @@ 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 immUniformArray3fv(const char* name, const float *data, int count);
|
||||
void immUniform4f(const char* name, float x, float y, float z, float w);
|
||||
void immUniform4fv(const char* name, const float data[4]);
|
||||
void immUniformMatrix4fv(const char* name, const float data[4][4]);
|
||||
|
||||
|
||||
// convenience functions for setting "uniform vec4 color"
|
||||
|
||||
Reference in New Issue
Block a user