Fix T61594: Frame playback is blank
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 19 Feb 2019 12:01:36 +0000 (13:01 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 19 Feb 2019 12:01:36 +0000 (13:01 +0100)
Viewport and scissor were never initialized prior to
window move/resize.

source/blender/windowmanager/intern/wm_playanim.c

index 0933e45..58e5882 100644 (file)
@@ -1256,8 +1256,6 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
                GHOST_AddEventConsumer(g_WS.ghost_system, consumer);
 
                playanim_window_open("Blender:Anim", start_x, start_y, ibuf->x, ibuf->y);
-
-               playanim_gl_matrix();
        }
 
        GHOST_GetMainDisplayDimensions(g_WS.ghost_system, &maxwinx, &maxwiny);
@@ -1287,6 +1285,12 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
        glClearColor(0.1, 0.1, 0.1, 0.0);
        glClear(GL_COLOR_BUFFER_BIT);
 
+       int win_x, win_y;
+       playanim_window_get_size(&win_x, &win_y);
+       glViewport(0, 0, win_x, win_y);
+       glScissor(0, 0, win_x, win_y);
+       playanim_gl_matrix();
+
        GHOST_SwapWindowBuffers(g_WS.ghost_window);
 
        if (sfra == -1 || efra == -1) {