GWN: Add GWN_batch_uniform_mat4.
authorClément Foucault <foucault.clem@gmail.com>
Mon, 23 Apr 2018 19:01:16 +0000 (21:01 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 2 May 2018 18:49:38 +0000 (20:49 +0200)
intern/gawain/gawain/gwn_batch.h
intern/gawain/src/gwn_batch.c

index 23bec80a0d12fd098d5d7c03cbadcce876c74d37..07ef96061b7e4e8c72307a9916ba4810540da9a3 100644 (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*);
 
index 9243c9f6fc43cb8453eada1d120c54d21b4422db..2e3a4eff0f0900272acde69f87e73c9023e137ca 100644 (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