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>2017-02-19 03:53:55 +0300
committerMike Erwin <significant.bit@gmail.com>2017-02-19 03:53:55 +0300
commit9f839a2ff52ea4e56c037c466cf1f173725f32b6 (patch)
treee7678fde64c702de587ecd7d2bc62ce4b68bc86a /source/blender/gpu/intern/gpu_matrix.c
parentfae895125efe1b5c1c9b9280cd0597b9b3b40445 (diff)
OpenGL: fix MVP matrix order
Numbers were correct but names were mixed up.
Diffstat (limited to 'source/blender/gpu/intern/gpu_matrix.c')
-rw-r--r--source/blender/gpu/intern/gpu_matrix.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/source/blender/gpu/intern/gpu_matrix.c b/source/blender/gpu/intern/gpu_matrix.c
index 2a77db6625a..a987e3ba1ce 100644
--- a/source/blender/gpu/intern/gpu_matrix.c
+++ b/source/blender/gpu/intern/gpu_matrix.c
@@ -595,28 +595,23 @@ const float *gpuGetProjectionMatrix3D(float m[4][4])
const float *gpuGetModelViewProjectionMatrix3D(float m[4][4])
{
+ if (m == NULL) {
+ static Mat4 temp;
+ m = temp;
+ }
+
#if SUPPORT_LEGACY_MATRIX
if (state.mode == MATRIX_MODE_INACTIVE) {
- if (m == NULL) {
- static Mat4 temp;
- m = temp;
- }
-
Mat4 proj;
- glGetFloatv(GL_MODELVIEW_MATRIX, (float*)proj);
- glGetFloatv(GL_PROJECTION_MATRIX, (float*)m);
- mul_m4_m4_post(m, proj);
+ glGetFloatv(GL_MODELVIEW_MATRIX, (float*)m);
+ glGetFloatv(GL_PROJECTION_MATRIX, (float*)proj);
+ mul_m4_m4_pre(m, proj);
return (const float*)m;
}
#endif
BLI_assert(state.mode == MATRIX_MODE_3D);
- if (m == NULL) {
- static Mat4 temp;
- m = temp;
- }
-
mul_m4_m4m4(m, Projection3D, ModelView3D);
return (const float*)m;
}