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 00:49:21 +0300
committerMike Erwin <significant.bit@gmail.com>2017-03-22 00:49:21 +0300
commit6d2aca5a96efd8ac61eec633c43a41e641379a68 (patch)
treede0d38249d8b439bf360ceb8d77f8112d4047f9e /source/blender/windowmanager/intern/wm_subwindow.c
parent7aad5cf573a964753b37573c5a2ea12af5d5952a (diff)
OpenGL: convert to new matrix API (part 5)
Pretty sure source/blender is now finished, with all legacy matrix calls confined to gpu_matrix.c. This was the easy part, but doing it first makes the next part much easier. TODO and XXX notes describe what is left. glMatrixMode is still in place, since the new API does not share this concept of modes. Similar for glOrtho and glFrustum which I'll tackle very soon. Part of T49450
Diffstat (limited to 'source/blender/windowmanager/intern/wm_subwindow.c')
-rw-r--r--source/blender/windowmanager/intern/wm_subwindow.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
index c401a11f74d..489f0b8013f 100644
--- a/source/blender/windowmanager/intern/wm_subwindow.c
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -47,6 +47,8 @@
#include "BIF_gl.h"
+#include "GPU_matrix.h"
+
#include "WM_api.h"
#include "wm_subwindow.h"
@@ -147,7 +149,7 @@ static void wm_swin_matrix_get(wmWindow *win, wmSubWindow *swin, float mat[4][4]
orthographic_m4(mat, -GLA_PIXEL_OFS, (float)width - GLA_PIXEL_OFS, -GLA_PIXEL_OFS, (float)height - GLA_PIXEL_OFS, -100, 100);
}
else {
- glGetFloatv(GL_PROJECTION_MATRIX, (float *)mat);
+ gpuGetProjectionMatrix3D(mat);
}
}
void wm_subwindow_matrix_get(wmWindow *win, int swinid, float mat[4][4])
@@ -213,7 +215,7 @@ int wm_subwindow_open(wmWindow *win, const rcti *winrct, bool activate)
/* extra service */
wm_swin_size_get(swin, &width, &height);
wmOrtho2_pixelspace(width, height);
- glLoadIdentity();
+ gpuLoadIdentity();
}
return swin->swinid;
@@ -319,7 +321,7 @@ void wmSubWindowScissorSet(wmWindow *win, int swinid, const rcti *srct, bool src
glScissor(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height);
wmOrtho2_pixelspace(width, height);
- glLoadIdentity();
+ gpuLoadIdentity();
glFlush();
}
@@ -333,7 +335,7 @@ void wmSubWindowSet(wmWindow *win, int swinid)
void wmFrustum(float x1, float x2, float y1, float y2, float n, float f)
{
glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
+ gpuLoadIdentity();
glFrustum(x1, x2, y1, y2, n, f);
glMatrixMode(GL_MODELVIEW);
}
@@ -341,7 +343,7 @@ void wmFrustum(float x1, float x2, float y1, float y2, float n, float f)
void wmOrtho(float x1, float x2, float y1, float y2, float n, float f)
{
glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
+ gpuLoadIdentity();
glOrtho(x1, x2, y1, y2, n, f);