diff src/video/quartz/SDL_QuartzVideo.m @ 498:4b8ff8ac2c07

Fixed window update problems on MacOS X 10.2 (thanks Darrell!)
author Sam Lantinga <slouken@libsdl.org>
date Mon, 16 Sep 2002 18:38:09 +0000
parents 8a43e0cbf02f
children c335456c421d
line wrap: on
line diff
--- 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) {