GWN: Batch: Add GWN_batch_uniform_4fv_array

This commit is contained in:
Clément Foucault 2018-03-29 03:00:29 +02:00
parent 8301b26452
commit 3c48a21833
2 changed files with 7 additions and 0 deletions

View File

@ -113,6 +113,7 @@ void GWN_batch_uniform_4f(Gwn_Batch*, const char* name, float x, float y, float
void GWN_batch_uniform_2fv(Gwn_Batch*, const char* name, const float data[2]);
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_4fv_array(Gwn_Batch*, const char* name, int len, const float *data);
void GWN_batch_draw(Gwn_Batch*);

View File

@ -489,6 +489,12 @@ void GWN_batch_uniform_4fv(Gwn_Batch* batch, const char* name, const float data[
glUniform4fv(uniform->location, 1, data);
}
void GWN_batch_uniform_4fv_array(Gwn_Batch* batch, const char* name, const int len, const float *data)
{
GET_UNIFORM
glUniform4fv(uniform->location, len, 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