diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-04-15 08:29:25 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-04-15 08:29:56 +0300 |
commit | 4b043994e8795f37e9227362fe24fd66d45c6b39 (patch) | |
tree | 921b417669349cc5cc592634bf7b304a4f3820de /source/blender/editors/screen/glutil.c | |
parent | ff3942505a8d861d0024ce4e95bd80da6ee303de (diff) |
GPU Matrix API: clean up after 2D-3D unification
See GPU_matrix.h & gpu_matrix.c for the important changes. Other files are mostly just updated to use the latest API.
- remove unused functions, defines, enums, comments
- remove "3D" from function names
- init to Identity transform (otherwise empty stack)
- gpuMatrixReset lets outside code return to initial state
Part of T49450
Follow up to D2626 and 49fc9cff3b90
Diffstat (limited to 'source/blender/editors/screen/glutil.c')
-rw-r--r-- | source/blender/editors/screen/glutil.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index a54bd8a290a..43f77a7d5b5 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -367,18 +367,8 @@ void glaDefine2DArea(rcti *screen_rect) * Programming Guide, Appendix H, Correctness Tips. */ -#if 1 /* new style */ gpuOrtho2D(GLA_PIXEL_OFS, sc_w + GLA_PIXEL_OFS, GLA_PIXEL_OFS, sc_h + GLA_PIXEL_OFS); gpuLoadIdentity(); -#else /* original */ - glMatrixMode(GL_PROJECTION); - gpuLoadIdentity(); - glOrtho(0.0, sc_w, 0.0, sc_h, -1, 1); - gpuTranslate2f(GLA_PIXEL_OFS, GLA_PIXEL_OFS); - - glMatrixMode(GL_MODELVIEW); - gpuLoadIdentity(); -#endif } /* TODO(merwin): put the following 2D code to use, or build new 2D code inspired & informd by it */ @@ -436,8 +426,8 @@ gla2DDrawInfo *glaBegin2DDraw(rcti *screen_rect, rctf *world_rect) glGetIntegerv(GL_VIEWPORT, (GLint *)di->orig_vp); glGetIntegerv(GL_SCISSOR_BOX, (GLint *)di->orig_sc); - gpuGetProjectionMatrix3D(di->orig_projmat); - gpuGetModelViewMatrix3D(di->orig_viewmat); + gpuGetProjectionMatrix(di->orig_projmat); + gpuGetModelViewMatrix(di->orig_viewmat); di->screen_rect = *screen_rect; if (world_rect) { @@ -488,8 +478,8 @@ 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]); - gpuLoadProjectionMatrix3D(di->orig_projmat); - gpuLoadMatrix3D(di->orig_viewmat); + gpuLoadProjectionMatrix(di->orig_projmat); + gpuLoadMatrix(di->orig_viewmat); MEM_freeN(di); } @@ -513,7 +503,7 @@ void bglPolygonOffset(float viewdist, float dist) // glPolygonOffset(-1.0, -1.0); /* hack below is to mimic polygon offset */ - gpuGetProjectionMatrix3D((float (*)[4])winmat); + gpuGetProjectionMatrix(winmat); /* dist is from camera to center point */ @@ -550,7 +540,7 @@ void bglPolygonOffset(float viewdist, float dist) offset = 0.0; } - gpuLoadProjectionMatrix3D((const float (*)[4])winmat); + gpuLoadProjectionMatrix(winmat); } /* **** Color management helper functions for GLSL display/transform ***** */ |