[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52092] trunk/blender/source/blender/ windowmanager/intern/wm_window.c: MultiSample feature: added provision that requires a restart in order to get

Ton Roosendaal ton at blender.org
Sun Nov 11 13:02:42 CET 2012


Revision: 52092
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52092
Author:   ton
Date:     2012-11-11 12:02:39 +0000 (Sun, 11 Nov 2012)
Log Message:
-----------
MultiSample feature: added provision that requires a restart in order to get
it work properly - you cannot set/disable it in a running program with windows
open. 

In short: Multisample setting is static, set on first time running of Blender,
after reading the user preferences.

For as far as I can see - disabling/enableing (glEnable) doesn't harm to be
used in drawing code. With multisample on at start, you can enable and disable it
freely. But without it set at start, enabling doesn't do anything nor draws badly.

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_window.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_window.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_window.c	2012-11-11 11:00:55 UTC (rev 52091)
+++ trunk/blender/source/blender/windowmanager/intern/wm_window.c	2012-11-11 12:02:39 UTC (rev 52092)
@@ -333,8 +333,14 @@
 static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
 {
 	GHOST_WindowHandle ghostwin;
+	static int multisamples = -1;
 	int scr_w, scr_h, posy;
 	
+	/* force setting multisamples only once, it requires restart - and you cannot 
+	   mix it, either all windows have it, or none (tested in OSX opengl) */
+	if (multisamples == -1)
+		multisamples = U.ogl_multisamples;
+	
 	wm_get_screensize(&scr_w, &scr_h);
 	posy = (scr_h - win->posy - win->sizey);
 	
@@ -345,7 +351,7 @@
 	                              (GHOST_TWindowState)win->windowstate,
 	                              GHOST_kDrawingContextTypeOpenGL,
 	                              0 /* no stereo */,
-	                              U.ogl_multisamples /* AA */);
+								  multisamples /* AA */);
 	
 	if (ghostwin) {
 		/* needed so we can detect the graphics card below */




More information about the Bf-blender-cvs mailing list