Fixed fullscreen OpenGL on Lion when built with the Mac OS X 10.4u SDK.
1.1 --- a/src/video/quartz/SDL_QuartzVideo.m Fri Sep 16 01:37:44 2011 -0400
1.2 +++ b/src/video/quartz/SDL_QuartzVideo.m Fri Sep 16 01:55:46 2011 -0400
1.3 @@ -805,24 +805,22 @@
1.4
1.5 [ [ qz_window contentView ] addSubview:window_view ];
1.6
1.7 - if ( isLion ) {
1.8 - [ qz_window setLevel:CGShieldingWindowLevel() ];
1.9 - [ gl_context setView: window_view ];
1.10 - [ gl_context setFullScreen ];
1.11 - [ gl_context update ];
1.12 + /* Apparently Lion checks some version flag set by the linker
1.13 + and changes API behavior. Annoying. */
1.14 +#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
1.15 + [ qz_window setLevel:NSNormalWindowLevel ];
1.16 + ctx = QZ_GetCGLContextObj (gl_context);
1.17 + err = CGLSetFullScreen (ctx);
1.18 +
1.19 + if (err) {
1.20 + SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
1.21 + goto ERR_NO_GL;
1.22 }
1.23 -
1.24 -#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
1.25 - if ( !isLion) {
1.26 - [ qz_window setLevel:NSNormalWindowLevel ];
1.27 - ctx = QZ_GetCGLContextObj (gl_context);
1.28 - err = CGLSetFullScreen (ctx);
1.29 -
1.30 - if (err) {
1.31 - SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
1.32 - goto ERR_NO_GL;
1.33 - }
1.34 - }
1.35 +#else
1.36 + [ qz_window setLevel:CGShieldingWindowLevel() ];
1.37 + [ gl_context setView: window_view ];
1.38 + [ gl_context setFullScreen ];
1.39 + [ gl_context update ];
1.40 #endif
1.41
1.42 [ window_view release ];