# HG changeset patch # User Sam Lantinga # Date 1032201489 0 # Node ID 4b8ff8ac2c07b5cdc3dd4a9efd90d77c2254055a # Parent bb2d68294e810eab9c7c749d490f8fecb0ab6b17 Fixed window update problems on MacOS X 10.2 (thanks Darrell!) diff -r bb2d68294e81 -r 4b8ff8ac2c07 src/video/quartz/SDL_QuartzVideo.h --- a/src/video/quartz/SDL_QuartzVideo.h Mon Sep 16 08:22:25 2002 +0000 +++ b/src/video/quartz/SDL_QuartzVideo.h Mon Sep 16 18:38:09 2002 +0000 @@ -227,6 +227,8 @@ static int QZ_SetColors (_THIS, int first_color, int num_colors, SDL_Color *colors); static void QZ_DirectUpdate (_THIS, int num_rects, SDL_Rect *rects); +static int QZ_LockWindow (_THIS, SDL_Surface *surface); +static void QZ_UnlockWindow (_THIS, SDL_Surface *surface); static void QZ_UpdateRects (_THIS, int num_rects, SDL_Rect *rects); static void QZ_VideoQuit (_THIS); diff -r bb2d68294e81 -r 4b8ff8ac2c07 src/video/quartz/SDL_QuartzVideo.m --- a/src/video/quartz/SDL_QuartzVideo.m Mon Sep 16 08:22:25 2002 +0000 +++ b/src/video/quartz/SDL_QuartzVideo.m Mon Sep 16 18:38:09 2002 +0000 @@ -576,10 +576,12 @@ LockPortBits ( [ window_view qdPort ] ); current->pixels = GetPixBaseAddr ( GetPortPixMap ( [ window_view qdPort ] ) ); current->pitch = GetPixRowBytes ( GetPortPixMap ( [ window_view qdPort ] ) ); - + UnlockPortBits ( [ window_view qdPort ] ); + current->flags |= SDL_SWSURFACE; current->flags |= SDL_PREALLOC; - + current->flags |= SDL_ASYNCBLIT; + if ( flags & SDL_NOFRAME ) current->flags |= SDL_NOFRAME; if ( flags & SDL_RESIZABLE ) @@ -590,7 +592,9 @@ current->pixels += 22 * current->pitch; } - this->UpdateRects = QZ_UpdateRects; + this->UpdateRects = QZ_UpdateRects; + this->LockHWSurface = QZ_LockWindow; + this->UnlockHWSurface = QZ_UnlockWindow; } /* Save flags to ensure correct teardown */ @@ -913,6 +917,17 @@ #endif } +/* Locking functions for the software window buffer */ +static int QZ_LockWindow (_THIS, SDL_Surface *surface) { + + return LockPortBits ( [ window_view qdPort ] ); +} + +static void QZ_UnlockWindow (_THIS, SDL_Surface *surface) { + + UnlockPortBits ( [ window_view qdPort ] ); +} + static void QZ_UpdateRects (_THIS, int numRects, SDL_Rect *rects) { if (SDL_VideoSurface->flags & SDL_OPENGLBLIT) {