Fix animation player

This commit is contained in:
Campbell Barton 2018-06-19 16:13:10 +02:00
parent e49f6bb208
commit 1c6ca9dc90
Notes: blender-bot 2023-02-14 05:43:11 +01:00
Referenced by issue #55521, broken play render animation
1 changed files with 9 additions and 0 deletions

View File

@ -66,6 +66,7 @@
#include "GPU_matrix.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_batch.h"
#include "DNA_scene_types.h"
#include "ED_datafiles.h" /* for fonts */
@ -179,6 +180,7 @@ typedef enum eWS_Qual {
static struct WindowStateGlobal {
GHOST_SystemHandle ghost_system;
void *ghost_window;
Gwn_Context *gwn_context;
/* events */
eWS_Qual qual;
@ -1262,6 +1264,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
//GHOST_ActivateWindowDrawingContext(g_WS.ghost_window);
/* initialize OpenGL immediate mode */
g_WS.gwn_context = GWN_context_create();
immInit();
/* initialize the font */
@ -1538,6 +1541,12 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
immDestroy();
if (g_WS.gwn_context) {
GWN_context_active_set(g_WS.gwn_context);
GWN_context_discard(g_WS.gwn_context);
g_WS.gwn_context = NULL;
}
BLF_exit();
GHOST_DisposeWindow(g_WS.ghost_system, g_WS.ghost_window);