GWN: Add GWN_batch_uniform_mat4.

This commit is contained in:
Clément Foucault 2018-04-23 21:01:16 +02:00
parent a8463284bb
commit 2602198485
2 changed files with 7 additions and 0 deletions

View File

@ -115,6 +115,7 @@ void GWN_batch_uniform_3fv(Gwn_Batch*, const char* name, const float data[3]);
void GWN_batch_uniform_4fv(Gwn_Batch*, const char* name, const float data[4]);
void GWN_batch_uniform_2fv_array(Gwn_Batch*, const char* name, int len, const float *data);
void GWN_batch_uniform_4fv_array(Gwn_Batch*, const char* name, int len, const float *data);
void GWN_batch_uniform_mat4(Gwn_Batch*, const char* name, const float data[4][4]);
void GWN_batch_draw(Gwn_Batch*);

View File

@ -503,6 +503,12 @@ void GWN_batch_uniform_4fv_array(Gwn_Batch* batch, const char* name, const int l
glUniform4fv(uniform->location, len, data);
}
void GWN_batch_uniform_mat4(Gwn_Batch* batch, const char* name, const float data[4][4])
{
GET_UNIFORM
glUniformMatrix4fv(uniform->location, 1, GL_FALSE, (const float *)data);
}
static void primitive_restart_enable(const Gwn_IndexBuf *el)
{
// TODO(fclem) Replace by GL_PRIMITIVE_RESTART_FIXED_INDEX when we have ogl 4.3