Skip to content

Commit

Permalink
Fixed fullscreen OpenGL on Lion when built with the Mac OS X 10.4u SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 16, 2011
1 parent 9fbe67b commit d834f01
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/video/quartz/SDL_QuartzVideo.m
Expand Up @@ -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 ];
Expand Down

0 comments on commit d834f01

Please sign in to comment.