diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 3 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 11 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_Application.cpp | 15 |
5 files changed, 31 insertions, 10 deletions
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 3ac923a72ef..afa1f03a8ca 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -667,9 +667,10 @@ typedef enum eUserpref_UI_Flag { /* uiflag2 */ typedef enum eUserpref_UI_Flag2 { - USER_KEEP_SESSION = (1 << 0), - USER_REGION_OVERLAP = (1 << 1), - USER_TRACKPAD_NATURAL = (1 << 2) + USER_KEEP_SESSION = (1 << 0), + USER_REGION_OVERLAP = (1 << 1), + USER_TRACKPAD_NATURAL = (1 << 2), + USER_OPENGL_NO_WARN_SUPPORT = (1 << 3) } eUserpref_UI_Flag2; /* Auto-Keying mode */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 15ecf70a938..7c4793f13a0 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3338,6 +3338,11 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Prompt Quit", "Asks for confirmation when quitting through the window close button"); + prop = RNA_def_property(srna, "use_gl_warn_support", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag2", USER_OPENGL_NO_WARN_SUPPORT); + RNA_def_property_ui_text(prop, "Warn On Deprecated OpenGL", + "Pops up a warning when an old OpenGL version is detected"); + /* Toolbox click-hold delay */ prop = RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse"); diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 232c9ad2e4d..31883cf234c 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -848,6 +848,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) static void playanim_window_open(const char *title, int posx, int posy, int sizex, int sizey) { + GHOST_GLSettings glsettings = {0}; GHOST_TUns32 scr_w, scr_h; GHOST_GetMainDisplayDimensions(g_WS.ghost_system, &scr_w, &scr_h); @@ -860,7 +861,7 @@ static void playanim_window_open(const char *title, int posx, int posy, int size /* could optionally start fullscreen */ GHOST_kWindowStateNormal, GHOST_kDrawingContextTypeOpenGL, - false /* no stereo */, false); + glsettings); } static void playanim_window_zoom(PlayState *ps, const float zoom_offset) diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 52fcdd797cb..cb2f728101b 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -356,14 +356,18 @@ float wm_window_pixelsize(wmWindow *win) static void wm_window_add_ghostwindow(wmWindowManager *wm, const char *title, wmWindow *win) { GHOST_WindowHandle ghostwin; + GHOST_GLSettings glSettings = {0}; 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; - + glSettings.numOfAASamples = U.ogl_multisamples; + + if (!(U.uiflag2 & USER_OPENGL_NO_WARN_SUPPORT)) + glSettings.flags |= GHOST_glWarnSupport; + wm_get_screensize(&scr_w, &scr_h); posy = (scr_h - win->posy - win->sizey); @@ -371,8 +375,7 @@ static void wm_window_add_ghostwindow(wmWindowManager *wm, const char *title, wm win->posx, posy, win->sizex, win->sizey, (GHOST_TWindowState)win->windowstate, GHOST_kDrawingContextTypeOpenGL, - 0 /* no stereo */, - multisamples /* AA */); + glSettings); if (ghostwin) { GHOST_RectangleHandle bounds; diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 2791931fe43..817c04a0044 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -323,11 +323,16 @@ bool GPG_Application::startWindow( const int stereoMode, const GHOST_TUns16 samples) { + GHOST_GLSettings glSettings = {0}; bool success; // Create the main window //STR_String title ("Blender Player - GHOST"); + if (stereoVisual) + glSettings.flags |= GHOST_glStereoVisual; + glSettings.numOfAASamples = samples; + m_mainWindow = fSystem->createWindow(title, windowLeft, windowTop, windowWidth, windowHeight, GHOST_kWindowStateNormal, - GHOST_kDrawingContextTypeOpenGL, stereoVisual, false, samples); + GHOST_kDrawingContextTypeOpenGL, glSettings); if (!m_mainWindow) { printf("error: could not create main window\n"); exit(-1); @@ -354,10 +359,16 @@ bool GPG_Application::startEmbeddedWindow( const GHOST_TUns16 samples) { GHOST_TWindowState state = GHOST_kWindowStateNormal; + GHOST_GLSettings glSettings = {0}; + + if (stereoVisual) + glSettings.flags |= GHOST_glStereoVisual; + glSettings.numOfAASamples = samples; + if (parentWindow != 0) state = GHOST_kWindowStateEmbedded; m_mainWindow = fSystem->createWindow(title, 0, 0, 0, 0, state, - GHOST_kDrawingContextTypeOpenGL, stereoVisual, false, samples, parentWindow); + GHOST_kDrawingContextTypeOpenGL, glSettings, parentWindow); if (!m_mainWindow) { printf("error: could not create main window\n"); |