From d834f01cf646e130375f592cad46e96e040909a4 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 16 Sep 2011 01:55:46 -0400 Subject: [PATCH] Fixed fullscreen OpenGL on Lion when built with the Mac OS X 10.4u SDK. --- src/video/quartz/SDL_QuartzVideo.m | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/video/quartz/SDL_QuartzVideo.m b/src/video/quartz/SDL_QuartzVideo.m index c1a509091..8b26df8f0 100644 --- a/src/video/quartz/SDL_QuartzVideo.m +++ b/src/video/quartz/SDL_QuartzVideo.m @@ -805,24 +805,22 @@ other blitting while waiting on the VBL (and hence results in higher framerates) [ [ qz_window contentView ] addSubview:window_view ]; - if ( isLion ) { - [ qz_window setLevel:CGShieldingWindowLevel() ]; - [ gl_context setView: window_view ]; - [ gl_context setFullScreen ]; - [ gl_context update ]; - } - -#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070) - if ( !isLion) { - [ qz_window setLevel:NSNormalWindowLevel ]; - ctx = QZ_GetCGLContextObj (gl_context); - err = CGLSetFullScreen (ctx); + /* 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 (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 ];