Skip to content

Commit

Permalink
Fixed window update problems on MacOS X 10.2 (thanks Darrell!)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 16, 2002
1 parent d486300 commit b808763
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/video/quartz/SDL_QuartzVideo.h
Expand Up @@ -227,6 +227,8 @@ static int QZ_ToggleFullScreen (_THIS, int on);
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);

Expand Down
21 changes: 18 additions & 3 deletions src/video/quartz/SDL_QuartzVideo.m
Expand Up @@ -576,10 +576,12 @@ static void QZ_UnsetVideoMode (_THIS) {
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 )
Expand All @@ -590,7 +592,9 @@ static void QZ_UnsetVideoMode (_THIS) {
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 */
Expand Down Expand Up @@ -913,6 +917,17 @@ they are too big (but will work) for background windows */
#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) {
Expand Down

0 comments on commit b808763

Please sign in to comment.