From 489665a4cbb7f751b9fc7f045b9566d5295327a5 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 3 Nov 2011 23:58:24 -0400 Subject: [PATCH] Fixed a compiler warning when building with Mac OS X target < 10.7. --HG-- branch : SDL-1.2 --- src/video/quartz/SDL_QuartzVideo.m | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/video/quartz/SDL_QuartzVideo.m b/src/video/quartz/SDL_QuartzVideo.m index 41db79022..ba22e9f6c 100644 --- a/src/video/quartz/SDL_QuartzVideo.m +++ b/src/video/quartz/SDL_QuartzVideo.m @@ -798,9 +798,6 @@ static SDL_Surface* QZ_SetVideoFullScreen (_THIS, SDL_Surface *current, int widt /* Setup OpenGL for a fullscreen context */ if (flags & SDL_OPENGL) { - CGLError err; - CGLContextObj ctx; - if ( ! QZ_SetupOpenGL (this, bpp, flags) ) { goto ERR_NO_GL; } @@ -818,13 +815,18 @@ static SDL_Surface* QZ_SetVideoFullScreen (_THIS, SDL_Surface *current, int widt /* 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); + { + CGLError err; + CGLContextObj ctx; + + [ 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() ];