[Commits] SDL: Fixed fullscreen OpenGL on Lion when built with the Mac OS ...

libsdl.org revision control commits-owner at libsdl.org
Thu Sep 15 23:05:43 PDT 2011


details:   http://hg.libsdl.org/SDL/rev/19520acd1501
changeset: 5946:19520acd1501
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Fri Sep 16 01:55:46 2011 -0400
description:
Fixed fullscreen OpenGL on Lion when built with the Mac OS X 10.4u SDK.

diffstat:

 src/video/quartz/SDL_QuartzVideo.m |  32 +++++++++++++++-----------------
 1 files changed, 15 insertions(+), 17 deletions(-)

diffs (43 lines):

diff -r 3868f2e09b12 -r 19520acd1501 src/video/quartz/SDL_QuartzVideo.m
--- a/src/video/quartz/SDL_QuartzVideo.m	Fri Sep 16 01:37:44 2011 -0400
+++ b/src/video/quartz/SDL_QuartzVideo.m	Fri Sep 16 01:55:46 2011 -0400
@@ -805,24 +805,22 @@
 
         [ [ qz_window contentView ] addSubview:window_view ];
 
-        if ( isLion ) {
-            [ qz_window setLevel:CGShieldingWindowLevel() ];
-            [ gl_context setView: window_view ];
-            [ gl_context setFullScreen ];
-            [ gl_context update ];
+        /* Apparently Lion checks some version flag set by the linker
+           and changes API behavior. Annoying. */
+#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
+        [ qz_window setLevel:NSNormalWindowLevel ];
+        ctx = QZ_GetCGLContextObj (gl_context);
+        err = CGLSetFullScreen (ctx);
+    
+        if (err) {
+            SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
+            goto ERR_NO_GL;
         }
-
-#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
-        if ( !isLion) {
-            [ qz_window setLevel:NSNormalWindowLevel ];
-            ctx = QZ_GetCGLContextObj (gl_context);
-            err = CGLSetFullScreen (ctx);
-    
-            if (err) {
-                SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
-                goto ERR_NO_GL;
-            }
-        }
+#else
+        [ qz_window setLevel:CGShieldingWindowLevel() ];
+        [ gl_context setView: window_view ];
+        [ gl_context setFullScreen ];
+        [ gl_context update ];
 #endif
 
         [ window_view release ];


More information about the commits mailing list