Fixed fullscreen OpenGL on Lion when built with the Mac OS X 10.4u SDK. SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Fri, 16 Sep 2011 01:55:46 -0400
branchSDL-1.2
changeset 5946 19520acd1501
parent 5945 3868f2e09b12
child 5952 c838b121901e
Fixed fullscreen OpenGL on Lion when built with the Mac OS X 10.4u SDK.
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 ];