GWN: Batch: Add GWN_batch_uniform_4fv_array
authorClément Foucault <foucault.clem@gmail.com>
Thu, 29 Mar 2018 01:00:29 +0000 (03:00 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Thu, 29 Mar 2018 12:22:50 +0000 (14:22 +0200)
intern/gawain/gawain/gwn_batch.h
intern/gawain/src/gwn_batch.c

index 3e90ef091f119368e33c81776c04e9b2acbb38c0..a6c071abfbe5cfc57193ccf1f25a765dcb54b606 100644 (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*);
 
index c720ba967b598145c008e0f8b46b22690b533f45..8b16e8e1905d611b9a1094579f9dfe308745b64b 100644 (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