From 06d4aca87956a8d276f97dedce7a021d86fc03f6 Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Tue, 11 Oct 2016 21:13:13 -0400 Subject: 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 --- source/blender/gpu/GPU_matrix.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/blender/gpu/GPU_matrix.h') 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); -- cgit v1.2.3