src/video/quartz/SDL_QuartzVideo.h
changeset 588 2c6510c0a304
parent 563 04dcaf3da918
child 615 7ec821f3cbd0
     1.1 --- a/src/video/quartz/SDL_QuartzVideo.h	Sat Feb 01 19:56:45 2003 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzVideo.h	Sat Feb 01 19:59:23 2003 +0000
     1.3 @@ -53,7 +53,9 @@
     1.4  #include <Carbon/Carbon.h>
     1.5  #include <QuickTime/QuickTime.h>
     1.6  #include <IOKit/IOKitLib.h>	/* For powersave handling */
     1.7 +#include <pthread.h>
     1.8  
     1.9 +#include "SDL_thread.h"
    1.10  #include "SDL_video.h"
    1.11  #include "SDL_error.h"
    1.12  #include "SDL_timer.h"
    1.13 @@ -137,6 +139,11 @@
    1.14      Uint8              grab_state;         /* used to manage grab behavior */
    1.15      NSPoint            cursor_loc;         /* saved cursor coords, for activate/deactivate when grabbed */
    1.16      BOOL          	   cursor_visible;     /* tells if cursor was hidden or not */
    1.17 +    Uint8*             sw_buffers[2];      /* pointers to the two software buffers for double-buffer emulation */
    1.18 +    SDL_Thread         *thread;            /* thread for async updates to the screen */
    1.19 +    SDL_sem            *sem1, *sem2;       /* synchronization for async screen updates */
    1.20 +    Uint8              *current_buffer;    /* the buffer being copied to the screen */
    1.21 +    BOOL               quit_thread;        /* used to quit the async blitting thread */
    1.22      
    1.23      ImageDescriptionHandle yuv_idh;
    1.24      MatrixRecordPtr        yuv_matrix;
    1.25 @@ -176,6 +183,12 @@
    1.26  #define grab_state (this->hidden->grab_state)
    1.27  #define cursor_loc (this->hidden->cursor_loc)
    1.28  #define cursor_visible (this->hidden->cursor_visible)
    1.29 +#define sw_buffers (this->hidden->sw_buffers)
    1.30 +#define thread (this->hidden->thread)
    1.31 +#define sem1 (this->hidden->sem1)
    1.32 +#define sem2 (this->hidden->sem2)
    1.33 +#define current_buffer (this->hidden->current_buffer)
    1.34 +#define quit_thread (this->hidden->quit_thread)
    1.35  
    1.36  #define yuv_idh (this->hidden->yuv_idh)
    1.37  #define yuv_matrix (this->hidden->yuv_matrix)
    1.38 @@ -262,6 +275,8 @@
    1.39  
    1.40  extern CGSError CGSGetMouseEnabledFlags (CGSConnectionID cid, CGSWindowID wid, int *flags);
    1.41  
    1.42 +int CGSDisplayHWSync (CGDirectDisplayID id);
    1.43 +
    1.44  /* Bootstrap functions */
    1.45  static int              QZ_Available ();
    1.46  static SDL_VideoDevice* QZ_CreateDevice (int device_index);
    1.47 @@ -280,6 +295,13 @@
    1.48  static int          QZ_ToggleFullScreen (_THIS, int on);
    1.49  static int          QZ_SetColors        (_THIS, int first_color,
    1.50                                           int num_colors, SDL_Color *colors);
    1.51 +
    1.52 +static int          QZ_LockDoubleBuffer   (_THIS, SDL_Surface *surface);
    1.53 +static void         QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface);
    1.54 +static int          QZ_ThreadFlip         (_THIS);
    1.55 +static int          QZ_FlipDoubleBuffer   (_THIS, SDL_Surface *surface);
    1.56 +static void         QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect *rects);
    1.57 +
    1.58  static void         QZ_DirectUpdate     (_THIS, int num_rects, SDL_Rect *rects);
    1.59  static int          QZ_LockWindow       (_THIS, SDL_Surface *surface);
    1.60  static void         QZ_UnlockWindow     (_THIS, SDL_Surface *surface);