src/video/quartz/SDL_QuartzVideo.m
branchSDL-1.2
changeset 5606 cf638ceb1f2c
parent 5574 7b7ad16f9704
child 5619 8e0dd46ad0e0
equal deleted inserted replaced
5599:5d7e82c63e84 5606:cf638ceb1f2c
   409             Do this first to avoid trash on the display before fade
   409             Do this first to avoid trash on the display before fade
   410         */
   410         */
   411         if ( mode_flags & SDL_OPENGL ) {
   411         if ( mode_flags & SDL_OPENGL ) {
   412         
   412         
   413             QZ_TearDownOpenGL (this);
   413             QZ_TearDownOpenGL (this);
       
   414             #ifdef __powerpc__  /* we only use this for pre-10.3 compatibility. */
   414             CGLSetFullScreen (NULL);
   415             CGLSetFullScreen (NULL);
       
   416             #endif
   415         }
   417         }
   416         if (to_desktop) {
   418         if (to_desktop) {
   417             ShowMenuBar ();
   419             ShowMenuBar ();
   418             /* Restore original screen resolution/bpp */
   420             /* Restore original screen resolution/bpp */
   419             CGDisplaySwitchToMode (display_id, save_mode);
   421             CGDisplaySwitchToMode (display_id, save_mode);
   527     if (flags & SDL_OPENGL) {
   529     if (flags & SDL_OPENGL) {
   528 
   530 
   529         CGLError err;
   531         CGLError err;
   530         CGLContextObj ctx;
   532         CGLContextObj ctx;
   531 
   533 
   532         /* CGLSetFullScreen() will handle this for us. */
       
   533         [ qz_window setLevel:NSNormalWindowLevel ];
       
   534 
       
   535         if ( ! QZ_SetupOpenGL (this, bpp, flags) ) {
   534         if ( ! QZ_SetupOpenGL (this, bpp, flags) ) {
   536             goto ERR_NO_GL;
   535             goto ERR_NO_GL;
   537         }
   536         }
   538 
   537 
   539         /* Initialize the NSView and add it to our window.  The presence of a valid window and
   538         /* Initialize the NSView and add it to our window.  The presence of a valid window and
   540            view allow the cursor to be changed whilst in fullscreen.*/
   539            view allow the cursor to be changed whilst in fullscreen.*/
   541         window_view = [ [ NSView alloc ] initWithFrame:contentRect ];
   540         window_view = [ [ NSView alloc ] initWithFrame:contentRect ];
   542         [ [ qz_window contentView ] addSubview:window_view ];	
   541         [ [ qz_window contentView ] addSubview:window_view ];	
   543         [ window_view release ];
   542         [ window_view release ];
   544 
   543 
       
   544 #ifdef __powerpc__  /* there's a Cocoa API for this in 10.3 */
       
   545         /* CGLSetFullScreen() will handle this for us. */
       
   546         [ qz_window setLevel:NSNormalWindowLevel ];
       
   547 
   545         ctx = QZ_GetCGLContextObj (gl_context);
   548         ctx = QZ_GetCGLContextObj (gl_context);
   546         err = CGLSetFullScreen (ctx);
   549         err = CGLSetFullScreen (ctx);
   547 
       
   548         if (err) {
   550         if (err) {
   549             SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
   551             SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
   550             goto ERR_NO_GL;
   552             goto ERR_NO_GL;
   551         }
   553         }
       
   554 #else
       
   555         [ qz_window setLevel:CGShieldingWindowLevel() ];
       
   556         [ gl_context setView:window_view ];
       
   557         [ gl_context setFullScreen ];
       
   558         [ gl_context update ];
       
   559 #endif
   552 
   560 
   553         [ gl_context makeCurrentContext];
   561         [ gl_context makeCurrentContext];
   554 
   562 
   555         glClear (GL_COLOR_BUFFER_BIT);
   563         glClear (GL_COLOR_BUFFER_BIT);
   556 
   564