diff src/video/quartz/SDL_QuartzVideo.h @ 588:2c6510c0a304

Darrell added support for emulated SDL_DOUBLEBUF on MacOSX
author Sam Lantinga <slouken@libsdl.org>
date Sat, 01 Feb 2003 19:59:23 +0000
parents 04dcaf3da918
children 7ec821f3cbd0
line wrap: on
line diff
--- a/src/video/quartz/SDL_QuartzVideo.h	Sat Feb 01 19:56:45 2003 +0000
+++ b/src/video/quartz/SDL_QuartzVideo.h	Sat Feb 01 19:59:23 2003 +0000
@@ -53,7 +53,9 @@
 #include <Carbon/Carbon.h>
 #include <QuickTime/QuickTime.h>
 #include <IOKit/IOKitLib.h>	/* For powersave handling */
+#include <pthread.h>
 
+#include "SDL_thread.h"
 #include "SDL_video.h"
 #include "SDL_error.h"
 #include "SDL_timer.h"
@@ -137,6 +139,11 @@
     Uint8              grab_state;         /* used to manage grab behavior */
     NSPoint            cursor_loc;         /* saved cursor coords, for activate/deactivate when grabbed */
     BOOL          	   cursor_visible;     /* tells if cursor was hidden or not */
+    Uint8*             sw_buffers[2];      /* pointers to the two software buffers for double-buffer emulation */
+    SDL_Thread         *thread;            /* thread for async updates to the screen */
+    SDL_sem            *sem1, *sem2;       /* synchronization for async screen updates */
+    Uint8              *current_buffer;    /* the buffer being copied to the screen */
+    BOOL               quit_thread;        /* used to quit the async blitting thread */
     
     ImageDescriptionHandle yuv_idh;
     MatrixRecordPtr        yuv_matrix;
@@ -176,6 +183,12 @@
 #define grab_state (this->hidden->grab_state)
 #define cursor_loc (this->hidden->cursor_loc)
 #define cursor_visible (this->hidden->cursor_visible)
+#define sw_buffers (this->hidden->sw_buffers)
+#define thread (this->hidden->thread)
+#define sem1 (this->hidden->sem1)
+#define sem2 (this->hidden->sem2)
+#define current_buffer (this->hidden->current_buffer)
+#define quit_thread (this->hidden->quit_thread)
 
 #define yuv_idh (this->hidden->yuv_idh)
 #define yuv_matrix (this->hidden->yuv_matrix)
@@ -262,6 +275,8 @@
 
 extern CGSError CGSGetMouseEnabledFlags (CGSConnectionID cid, CGSWindowID wid, int *flags);
 
+int CGSDisplayHWSync (CGDirectDisplayID id);
+
 /* Bootstrap functions */
 static int              QZ_Available ();
 static SDL_VideoDevice* QZ_CreateDevice (int device_index);
@@ -280,6 +295,13 @@
 static int          QZ_ToggleFullScreen (_THIS, int on);
 static int          QZ_SetColors        (_THIS, int first_color,
                                          int num_colors, SDL_Color *colors);
+
+static int          QZ_LockDoubleBuffer   (_THIS, SDL_Surface *surface);
+static void         QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface);
+static int          QZ_ThreadFlip         (_THIS);
+static int          QZ_FlipDoubleBuffer   (_THIS, SDL_Surface *surface);
+static void         QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect *rects);
+
 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);