From 886dcf617e573862c45db8dc77316adcb6db0b05 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 11 Nov 2012 12:02:39 +0000 Subject: 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. --- source/blender/windowmanager/intern/wm_window.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 631bd0c9002..97052fd2fc6 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -333,8 +333,14 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win) 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 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win) (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 */ -- cgit v1.2.3