src/video/quartz/SDL_QuartzVideo.m
branchSDL-1.2
changeset 6048 a0538c8c39b5
parent 5986 4854219a91e9
child 6049 4b79fd1fd9a3
equal deleted inserted replaced
6047:54b2716f595d 6048:a0538c8c39b5
   796     }
   796     }
   797 
   797 
   798     /* Setup OpenGL for a fullscreen context */
   798     /* Setup OpenGL for a fullscreen context */
   799     if (flags & SDL_OPENGL) {
   799     if (flags & SDL_OPENGL) {
   800 
   800 
   801         CGLError err;
       
   802         CGLContextObj ctx;
       
   803 
       
   804         if ( ! QZ_SetupOpenGL (this, bpp, flags) ) {
   801         if ( ! QZ_SetupOpenGL (this, bpp, flags) ) {
   805             goto ERR_NO_GL;
   802             goto ERR_NO_GL;
   806         }
   803         }
   807 
   804 
   808         /* Initialize the NSView and add it to our window.  The presence of a valid window and
   805         /* Initialize the NSView and add it to our window.  The presence of a valid window and
   816         [ [ qz_window contentView ] addSubview:window_view ];
   813         [ [ qz_window contentView ] addSubview:window_view ];
   817 
   814 
   818         /* Apparently Lion checks some version flag set by the linker
   815         /* Apparently Lion checks some version flag set by the linker
   819            and changes API behavior. Annoying. */
   816            and changes API behavior. Annoying. */
   820 #if (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
   817 #if (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
   821         [ qz_window setLevel:NSNormalWindowLevel ];
   818         {
   822         ctx = QZ_GetCGLContextObj (gl_context);
   819             CGLError err;
   823         err = CGLSetFullScreen (ctx);
   820             CGLContextObj ctx;
   824     
   821 
   825         if (err) {
   822             [ qz_window setLevel:NSNormalWindowLevel ];
   826             SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
   823             ctx = QZ_GetCGLContextObj (gl_context);
   827             goto ERR_NO_GL;
   824             err = CGLSetFullScreen (ctx);
       
   825     
       
   826             if (err) {
       
   827                 SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
       
   828                 goto ERR_NO_GL;
       
   829             }
   828         }
   830         }
   829 #else
   831 #else
   830         [ qz_window setLevel:CGShieldingWindowLevel() ];
   832         [ qz_window setLevel:CGShieldingWindowLevel() ];
   831         [ gl_context setView: window_view ];
   833         [ gl_context setView: window_view ];
   832         [ gl_context setFullScreen ];
   834         [ gl_context setFullScreen ];