Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-04-23 22:01:16 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-05-02 21:49:38 +0300
commit26021984859b6c522a532e3613fe65ffed6cbc19 (patch)
treedfc924465c2ec33596a36dc2405b455e9e35ce1d
parenta8463284bb7f249c9f61b503d0d551bd94e1931f (diff)
GWN: Add GWN_batch_uniform_mat4.
-rw-r--r--intern/gawain/gawain/gwn_batch.h1
-rw-r--r--intern/gawain/src/gwn_batch.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/intern/gawain/gawain/gwn_batch.h b/intern/gawain/gawain/gwn_batch.h
index 23bec80a0d1..07ef96061b7 100644
--- a/intern/gawain/gawain/gwn_batch.h
+++ b/intern/gawain/gawain/gwn_batch.h
@@ -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*);
diff --git a/intern/gawain/src/gwn_batch.c b/intern/gawain/src/gwn_batch.c
index 9243c9f6fc4..2e3a4eff0f0 100644
--- a/intern/gawain/src/gwn_batch.c
+++ b/intern/gawain/src/gwn_batch.c
@@ -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