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:
authorMike Erwin <significant.bit@gmail.com>2016-10-12 04:13:13 +0300
committerMike Erwin <significant.bit@gmail.com>2016-10-12 04:16:26 +0300
commit06d4aca87956a8d276f97dedce7a021d86fc03f6 (patch)
tree76b55f17f167f360f12fb53587c92e5e41990969 /source/blender/gpu/GPU_matrix.h
parentc330f3713563fff855bfe69e44b070a956925d24 (diff)
OpenGL: matrix fixes & compatibility
Was multiplying matrices backward, so concatenation was broken. Fixed! Also a way to mix legacy matrix stacks with the new library. Just during the transition! Anything within SUPPORT_LEGACY_MATRIX will go away after we switch to core profile. Part of T49450
Diffstat (limited to 'source/blender/gpu/GPU_matrix.h')
-rw-r--r--source/blender/gpu/GPU_matrix.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h
index 73566292799..3c3acc08f58 100644
--- a/source/blender/gpu/GPU_matrix.h
+++ b/source/blender/gpu/GPU_matrix.h
@@ -39,6 +39,12 @@
extern "C" {
#endif
+/* For now we support the legacy matrix stack in gpuGetMatrix functions.
+ * Will remove this after switching to core profile, which can happen after
+ * we convert all code to use the API in this file. */
+#define SUPPORT_LEGACY_MATRIX 1
+
+
void gpuMatrixInit(void); /* called by system -- make private? */
@@ -120,6 +126,13 @@ const float *gpuGetModelViewMatrix3D(float m[4][4]);
const float *gpuGetProjectionMatrix3D(float m[4][4]);
const float *gpuGetModelViewProjectionMatrix3D(float m[4][4]);
+
+#if SUPPORT_LEGACY_MATRIX
+/* copy top matrix from each legacy stack into new fresh stack */
+void gpuMatrixBegin3D_legacy(void);
+#endif
+
+
/* set uniform values for currently bound shader */
void gpuBindMatrices(GLuint program);