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-03-22 21:48:47 +0300
committerMike Erwin <significant.bit@gmail.com>2017-03-22 21:48:47 +0300
commit98a0dd6888b74de132fa936e15f5d589042e8f91 (patch)
treeb3e0f498fd73dc7fda77d8393cc599b15e0265ac /source/blender/editors/screen/glutil.c
parent0c2fd1357d32744c59957e0bdc846d34e7b74f30 (diff)
OpenGL: load projection matrix with new API
New API does not share legacy OpenGL's concept of matrix modes. Part of T49450
Diffstat (limited to 'source/blender/editors/screen/glutil.c')
-rw-r--r--source/blender/editors/screen/glutil.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 0834f05706e..05572146df7 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -675,9 +675,7 @@ void glaEnd2DDraw(gla2DDrawInfo *di)
{
glViewport(di->orig_vp[0], di->orig_vp[1], di->orig_vp[2], di->orig_vp[3]);
glScissor(di->orig_vp[0], di->orig_vp[1], di->orig_vp[2], di->orig_vp[3]);
- glMatrixMode(GL_PROJECTION);
- gpuLoadMatrix3D(di->orig_projmat);
- glMatrixMode(GL_MODELVIEW);
+ gpuLoadProjectionMatrix3D(di->orig_projmat);
gpuLoadMatrix3D(di->orig_viewmat);
MEM_freeN(di);
@@ -702,7 +700,6 @@ void bglPolygonOffset(float viewdist, float dist)
// glPolygonOffset(-1.0, -1.0);
/* hack below is to mimic polygon offset */
- glMatrixMode(GL_PROJECTION);
gpuGetProjectionMatrix3D(winmat);
/* dist is from camera to center point */
@@ -734,17 +731,13 @@ void bglPolygonOffset(float viewdist, float dist)
winmat[14] -= offs;
offset += offs;
-
- gpuLoadMatrix3D(winmat);
- glMatrixMode(GL_MODELVIEW);
}
else {
- glMatrixMode(GL_PROJECTION);
winmat[14] += offset;
offset = 0.0;
- gpuLoadMatrix3D(winmat);
- glMatrixMode(GL_MODELVIEW);
}
+
+ gpuLoadProjectionMatrix3D(winmat);
}
/* **** Color management helper functions for GLSL display/transform ***** */