[Bf-blender-cvs] [6f220c1] blender2.8: inform immediate mode when switching OpenGL context

Mike Erwin noreply at git.blender.org
Thu Oct 13 06:40:26 CEST 2016


Commit: 6f220c1c55fd2cd4692ff017ccb2b0e6b28c6d3f
Author: Mike Erwin
Date:   Thu Oct 13 00:37:47 2016 -0400
Branches: blender2.8
https://developer.blender.org/rB6f220c1c55fd2cd4692ff017ccb2b0e6b28c6d3f

inform immediate mode when switching OpenGL context

Longstanding to-do is now to-done.

Heinous bug reported by @dfelinto pushed me to fix this.

===================================================================

M	source/blender/windowmanager/intern/wm_window.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 2d43c47..718a9af 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -76,7 +76,7 @@
 #include "GPU_draw.h"
 #include "GPU_extensions.h"
 #include "GPU_init_exit.h"
-#include "GPU_glew.h"
+#include "GPU_immediate.h"
 
 /* for assert */
 #ifndef NDEBUG
@@ -827,13 +827,16 @@ void wm_window_make_drawable(wmWindowManager *wm, wmWindow *win)
 {
 	if (win != wm->windrawable && win->ghostwin) {
 //		win->lmbut = 0;	/* keeps hanging when mousepressed while other window opened */
-		
+
 		wm->windrawable = win;
 		if (G.debug & G_DEBUG_EVENTS) {
 			printf("%s: set drawable %d\n", __func__, win->winid);
 		}
+
+		immDeactivate();
 		GHOST_ActivateWindowDrawingContext(win->ghostwin);
-		
+		immActivate();
+
 		/* this can change per window */
 		U.pixelsize = wm_window_pixelsize(win);
 		BKE_blender_userdef_refresh();




More information about the Bf-blender-cvs mailing list