diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-01 14:45:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-01 16:01:00 +0400 |
commit | b8f694177681ab9c46b495490b2d08577bfcdb34 (patch) | |
tree | 2451a58d47b051c8b8d63a69fac6b87f60e52001 /source/blender | |
parent | 1a72c83355587246b2543af25f3a86c205e73eed (diff) |
Cleanup: de-duplicate playanim matrix
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 024135e73e9..c701d3309c9 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -168,6 +168,15 @@ static void playanim_window_get_size(int *width_r, int *height_r) GHOST_DisposeRectangle(bounds); } +static void playanim_gl_matrix(void) +{ + /* unified matrix, note it affects offset for drawing */ + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f); + glMatrixMode(GL_MODELVIEW); +} + /* implementation */ static void playanim_event_qual_update(void) { @@ -780,11 +789,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) glViewport(0, 0, ps->win_x, ps->win_y); glScissor(0, 0, ps->win_x, ps->win_y); - /* unified matrix, note it affects offset for drawing */ - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); + playanim_gl_matrix(); glPixelZoom(ps->zoom, ps->zoom); ptottime = 0.0; @@ -1008,11 +1013,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv) playanim_window_open("Blender:Anim", start_x, start_y, ibuf->x, ibuf->y); - /* unified matrix, note it affects offset for drawing */ - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); + playanim_gl_matrix(); } GHOST_GetMainDisplayDimensions(g_WS.ghost_system, &maxwinx, &maxwiny); |