comparison src/video/quartz/SDL_QuartzVideo.m @ 560:37c31c12eb70

Moved some cleanup stuff to QZ_VideoQuit() from QZ_UnsetVideoMode()...fixes cursor hiding, etc when calling SDL_SetVideoMode() multiple times. Fixed by Darrell Walisser.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 13 Dec 2002 21:09:52 +0000
parents 2536446a92de
children 04dcaf3da918
comparison
equal deleted inserted replaced
559:b528214c8c9a 560:37c31c12eb70
394 394
395 /* Release the OpenGL context */ 395 /* Release the OpenGL context */
396 if ( mode_flags & SDL_OPENGL ) 396 if ( mode_flags & SDL_OPENGL )
397 QZ_TearDownOpenGL (this); 397 QZ_TearDownOpenGL (this);
398 } 398 }
399
400 /* Restore gamma settings */
401 CGDisplayRestoreColorSyncSettings ();
402
403 /* Ensure the cursor will be visible and working when we quit */
404 CGDisplayShowCursor (display_id);
405 CGAssociateMouseAndMouseCursorPosition (1);
406 399
407 /* Signal successful teardown */ 400 /* Signal successful teardown */
408 video_set = SDL_FALSE; 401 video_set = SDL_FALSE;
409 } 402 }
410 403
574 if (qz_window == nil) { 567 if (qz_window == nil) {
575 SDL_SetError ("Could not create the Cocoa window"); 568 SDL_SetError ("Could not create the Cocoa window");
576 return NULL; 569 return NULL;
577 } 570 }
578 571
579 [ qz_window setReleasedWhenClosed:YES ]; 572 //[ qz_window setReleasedWhenClosed:YES ];
580 QZ_SetCaption(this, this->wm_title, this->wm_icon); 573 QZ_SetCaption(this, this->wm_title, this->wm_icon);
581 [ qz_window setAcceptsMouseMovedEvents:YES ]; 574 [ qz_window setAcceptsMouseMovedEvents:YES ];
582 [ qz_window setViewsNeedDisplay:NO ]; 575 [ qz_window setViewsNeedDisplay:NO ];
583 [ qz_window center ]; 576 [ qz_window center ];
584 [ qz_window setDelegate: 577 [ qz_window setDelegate:
1059 } 1052 }
1060 } 1053 }
1061 1054
1062 static void QZ_VideoQuit (_THIS) { 1055 static void QZ_VideoQuit (_THIS) {
1063 1056
1057 /* Restore gamma settings */
1058 CGDisplayRestoreColorSyncSettings ();
1059
1060 /* Ensure the cursor will be visible and working when we quit */
1061 CGDisplayShowCursor (display_id);
1062 CGAssociateMouseAndMouseCursorPosition (1);
1063
1064 QZ_UnsetVideoMode (this); 1064 QZ_UnsetVideoMode (this);
1065 CGPaletteRelease (palette); 1065 CGPaletteRelease (palette);
1066 } 1066 }
1067 1067
1068 static int QZ_FillHWRect (_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color) { 1068 static int QZ_FillHWRect (_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color) {