From 62fe7e9a9d0e211bc2ad4cdfedb2489c5f899133 Mon Sep 17 00:00:00 2001 From: Tomoaki Kawada Date: Sat, 1 Jun 2019 17:54:07 +0200 Subject: GPU: support default framebuffer with ID not equal to 0 --- source/blender/windowmanager/intern/wm_playanim.c | 3 ++- source/blender/windowmanager/intern/wm_window.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager/intern') diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 7cc44bcad99..51dccf5bb8b 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -1287,7 +1287,8 @@ static char *wm_main_playanim_intern(int argc, const char **argv) // GHOST_ActivateWindowDrawingContext(g_WS.ghost_window); /* initialize OpenGL immediate mode */ - g_WS.gpu_context = GPU_context_create(); + GLuint default_fb = GHOST_GetDefaultOpenGLFramebuffer(g_WS.ghost_window); + g_WS.gpu_context = GPU_context_create(default_fb); GPU_init(); immActivate(); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 7ae572e5685..e9cf1cc5469 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -581,7 +581,8 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm if (ghostwin) { GHOST_RectangleHandle bounds; - win->gpuctx = GPU_context_create(); + GLuint default_fb = GHOST_GetDefaultOpenGLFramebuffer(ghostwin); + win->gpuctx = GPU_context_create(default_fb); /* needed so we can detect the graphics card below */ GPU_init(); -- cgit v1.2.3