Fixed window update problems on MacOS X 10.2 (thanks Darrell!)
authorSam Lantinga <slouken@libsdl.org>
Mon, 16 Sep 2002 18:38:09 +0000
changeset 4984b8ff8ac2c07
parent 497 bb2d68294e81
child 499 f480ecd70499
Fixed window update problems on MacOS X 10.2 (thanks Darrell!)
src/video/quartz/SDL_QuartzVideo.h
src/video/quartz/SDL_QuartzVideo.m
     1.1 --- a/src/video/quartz/SDL_QuartzVideo.h	Mon Sep 16 08:22:25 2002 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzVideo.h	Mon Sep 16 18:38:09 2002 +0000
     1.3 @@ -227,6 +227,8 @@
     1.4  static int          QZ_SetColors        (_THIS, int first_color,
     1.5                                           int num_colors, SDL_Color *colors);
     1.6  static void         QZ_DirectUpdate     (_THIS, int num_rects, SDL_Rect *rects);
     1.7 +static int 	     QZ_LockWindow       (_THIS, SDL_Surface *surface);
     1.8 +static void         QZ_UnlockWindow     (_THIS, SDL_Surface *surface);
     1.9  static void         QZ_UpdateRects      (_THIS, int num_rects, SDL_Rect *rects);
    1.10  static void         QZ_VideoQuit        (_THIS);
    1.11  
     2.1 --- a/src/video/quartz/SDL_QuartzVideo.m	Mon Sep 16 08:22:25 2002 +0000
     2.2 +++ b/src/video/quartz/SDL_QuartzVideo.m	Mon Sep 16 18:38:09 2002 +0000
     2.3 @@ -576,10 +576,12 @@
     2.4          LockPortBits ( [ window_view qdPort ] );
     2.5          current->pixels = GetPixBaseAddr ( GetPortPixMap ( [ window_view qdPort ] ) );
     2.6          current->pitch  = GetPixRowBytes ( GetPortPixMap ( [ window_view qdPort ] ) );
     2.7 -
     2.8 +        UnlockPortBits ( [ window_view qdPort ] );
     2.9 +        
    2.10          current->flags |= SDL_SWSURFACE;
    2.11          current->flags |= SDL_PREALLOC;
    2.12 -
    2.13 +        current->flags |= SDL_ASYNCBLIT;
    2.14 +        
    2.15          if ( flags & SDL_NOFRAME )
    2.16              current->flags |= SDL_NOFRAME;
    2.17          if ( flags & SDL_RESIZABLE )
    2.18 @@ -590,7 +592,9 @@
    2.19              current->pixels += 22 * current->pitch;
    2.20          }
    2.21  
    2.22 -        this->UpdateRects = QZ_UpdateRects;
    2.23 +        this->UpdateRects     = QZ_UpdateRects;
    2.24 +        this->LockHWSurface   = QZ_LockWindow;
    2.25 +        this->UnlockHWSurface = QZ_UnlockWindow;
    2.26      }
    2.27  
    2.28      /* Save flags to ensure correct teardown */
    2.29 @@ -913,6 +917,17 @@
    2.30  #endif
    2.31  }
    2.32  
    2.33 +/* Locking functions for the software window buffer */
    2.34 +static int QZ_LockWindow (_THIS, SDL_Surface *surface) {
    2.35 +    
    2.36 +    return LockPortBits ( [ window_view qdPort ] );
    2.37 +}
    2.38 +
    2.39 +static void QZ_UnlockWindow (_THIS, SDL_Surface *surface) {
    2.40 +
    2.41 +    UnlockPortBits ( [ window_view qdPort ] );
    2.42 +}
    2.43 +
    2.44  static void QZ_UpdateRects (_THIS, int numRects, SDL_Rect *rects) {
    2.45  
    2.46      if (SDL_VideoSurface->flags & SDL_OPENGLBLIT) {