comparison 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
comparison
equal deleted inserted replaced
497:bb2d68294e81 498:4b8ff8ac2c07
574 [ qz_window makeKeyAndOrderFront:nil ]; 574 [ qz_window makeKeyAndOrderFront:nil ];
575 575
576 LockPortBits ( [ window_view qdPort ] ); 576 LockPortBits ( [ window_view qdPort ] );
577 current->pixels = GetPixBaseAddr ( GetPortPixMap ( [ window_view qdPort ] ) ); 577 current->pixels = GetPixBaseAddr ( GetPortPixMap ( [ window_view qdPort ] ) );
578 current->pitch = GetPixRowBytes ( GetPortPixMap ( [ window_view qdPort ] ) ); 578 current->pitch = GetPixRowBytes ( GetPortPixMap ( [ window_view qdPort ] ) );
579 579 UnlockPortBits ( [ window_view qdPort ] );
580
580 current->flags |= SDL_SWSURFACE; 581 current->flags |= SDL_SWSURFACE;
581 current->flags |= SDL_PREALLOC; 582 current->flags |= SDL_PREALLOC;
582 583 current->flags |= SDL_ASYNCBLIT;
584
583 if ( flags & SDL_NOFRAME ) 585 if ( flags & SDL_NOFRAME )
584 current->flags |= SDL_NOFRAME; 586 current->flags |= SDL_NOFRAME;
585 if ( flags & SDL_RESIZABLE ) 587 if ( flags & SDL_RESIZABLE )
586 current->flags |= SDL_RESIZABLE; 588 current->flags |= SDL_RESIZABLE;
587 589
588 /* Offset 22 pixels down to fill the full content region */ 590 /* Offset 22 pixels down to fill the full content region */
589 if ( ! (current->flags & SDL_NOFRAME) ) { 591 if ( ! (current->flags & SDL_NOFRAME) ) {
590 current->pixels += 22 * current->pitch; 592 current->pixels += 22 * current->pitch;
591 } 593 }
592 594
593 this->UpdateRects = QZ_UpdateRects; 595 this->UpdateRects = QZ_UpdateRects;
596 this->LockHWSurface = QZ_LockWindow;
597 this->UnlockHWSurface = QZ_UnlockWindow;
594 } 598 }
595 599
596 /* Save flags to ensure correct teardown */ 600 /* Save flags to ensure correct teardown */
597 mode_flags = current->flags; 601 mode_flags = current->flags;
598 602
909 913
910 return obscured; 914 return obscured;
911 #else 915 #else
912 return SDL_TRUE; 916 return SDL_TRUE;
913 #endif 917 #endif
918 }
919
920 /* Locking functions for the software window buffer */
921 static int QZ_LockWindow (_THIS, SDL_Surface *surface) {
922
923 return LockPortBits ( [ window_view qdPort ] );
924 }
925
926 static void QZ_UnlockWindow (_THIS, SDL_Surface *surface) {
927
928 UnlockPortBits ( [ window_view qdPort ] );
914 } 929 }
915 930
916 static void QZ_UpdateRects (_THIS, int numRects, SDL_Rect *rects) { 931 static void QZ_UpdateRects (_THIS, int numRects, SDL_Rect *rects) {
917 932
918 if (SDL_VideoSurface->flags & SDL_OPENGLBLIT) { 933 if (SDL_VideoSurface->flags & SDL_OPENGLBLIT) {