src/video/quartz/SDL_QuartzVideo.h
changeset 390 19e73568a75c
parent 297 f6ffac90895c
child 435 140798e1e7a6
     1.1 --- a/src/video/quartz/SDL_QuartzVideo.h	Sat Jun 01 19:54:15 2002 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzVideo.h	Sat Jun 01 23:05:05 2002 +0000
     1.3 @@ -20,7 +20,7 @@
     1.4      slouken@libsdl.org
     1.5  */
     1.6  
     1.7 -/*	
     1.8 +/*    
     1.9      @file   SDL_QuartzVideo.h
    1.10      @author Darrell Walisser
    1.11      
    1.12 @@ -33,16 +33,15 @@
    1.13          - Keyboard repeat/mouse speed adjust (if needed)
    1.14          - Multiple monitor support (currently only main display)
    1.15          - Accelerated blitting support
    1.16 -        - Set the window icon (dock icon when API is available)
    1.17 -        - Fix white OpenGL window on minimize
    1.18 +        - Fix white OpenGL window on minimize (fixed)
    1.19          - Find out what events should be sent/ignored if window is mimimized
    1.20 -        - Find a better way to deal with resolution/depth switch while app is running
    1.21 +        - Find a way to deal with external resolution/depth switch while app is running
    1.22          - Resizeable windows
    1.23          - Check accuracy of QZ_SetGamma()
    1.24      Problems:
    1.25          - OGL not working in full screen with software renderer
    1.26          - SetColors sets palette correctly but clears framebuffer
    1.27 -        - Crash in CG after several mode switches
    1.28 +        - Crash in CG after several mode switches (I think this has been fixed)
    1.29          - Retained windows don't draw their title bar quite right (OS Bug) (not using retained windows)
    1.30          - Cursor in 8 bit modes is screwy (might just be Radeon PCI bug)
    1.31          - Warping cursor delays mouse events for a fraction of a second,
    1.32 @@ -52,6 +51,7 @@
    1.33  #include <Cocoa/Cocoa.h>
    1.34  #include <OpenGL/OpenGL.h>
    1.35  #include <Carbon/Carbon.h>
    1.36 +#include <QuickTime/QuickTime.h>
    1.37  
    1.38  #include "SDL_video.h"
    1.39  #include "SDL_error.h"
    1.40 @@ -102,10 +102,17 @@
    1.41      Uint32             warp_ticks;         /* timestamp when the warp occured */
    1.42      NSWindow           *window;            /* Cocoa window to implement the SDL window */
    1.43      NSQuickDrawView    *view;              /* the window's view; draw 2D into this view */
    1.44 -    
    1.45 +    ImageDescriptionHandle yuv_idh;
    1.46 +    MatrixRecordPtr        yuv_matrix;
    1.47 +    DecompressorComponent  yuv_codec;
    1.48 +    ImageSequence          yuv_seq;
    1.49 +    PlanarPixmapInfoYUV420 *yuv_pixmap;
    1.50 +    Sint16                  yuv_width, yuv_height;
    1.51 +    CGrafPtr                yuv_port;
    1.52 +
    1.53  } SDL_PrivateVideoData ;
    1.54  
    1.55 -#define _THIS	SDL_VideoDevice *this
    1.56 +#define _THIS    SDL_VideoDevice *this
    1.57  #define display_id (this->hidden->display)
    1.58  #define mode (this->hidden->mode)
    1.59  #define save_mode (this->hidden->save_mode)
    1.60 @@ -121,6 +128,15 @@
    1.61  #define video_set (this->hidden->video_set)
    1.62  #define warp_ticks (this->hidden->warp_ticks)
    1.63  #define warp_flag (this->hidden->warp_flag)
    1.64 +#define yuv_idh (this->hidden->yuv_idh)
    1.65 +#define yuv_matrix (this->hidden->yuv_matrix)
    1.66 +#define yuv_codec (this->hidden->yuv_codec)
    1.67 +#define yuv_seq (this->hidden->yuv_seq)
    1.68 +#define yuv_pixmap (this->hidden->yuv_pixmap)
    1.69 +#define yuv_data (this->hidden->yuv_data)
    1.70 +#define yuv_width (this->hidden->yuv_width)
    1.71 +#define yuv_height (this->hidden->yuv_height)
    1.72 +#define yuv_port (this->hidden->yuv_port)
    1.73  
    1.74  /* Obscuring code: maximum number of windows above ours (inclusive) */
    1.75  #define kMaxWindows 256
    1.76 @@ -144,16 +160,16 @@
    1.77  */
    1.78  
    1.79  typedef CGError       CGSError;
    1.80 -typedef long	      CGSWindowCount;
    1.81 -typedef void *	      CGSConnectionID;
    1.82 -typedef int	      CGSWindowID;
    1.83 +typedef long          CGSWindowCount;
    1.84 +typedef void *        CGSConnectionID;
    1.85 +typedef int           CGSWindowID;
    1.86  typedef CGSWindowID*  CGSWindowIDList;
    1.87  typedef CGWindowLevel CGSWindowLevel;
    1.88  typedef NSRect        CGSRect;
    1.89  
    1.90  extern CGSConnectionID _CGSDefaultConnection ();
    1.91  
    1.92 -extern CGSError CGSGetOnScreenWindowList (CGSConnectionID cid, 
    1.93 +extern CGSError CGSGetOnScreenWindowList (CGSConnectionID cid,
    1.94                                            CGSConnectionID owner,
    1.95                                            CGSWindowCount listCapacity,
    1.96                                            CGSWindowIDList list,
    1.97 @@ -166,9 +182,9 @@
    1.98  extern CGWindowLevel CGSGetWindowLevel (CGSConnectionID cid,
    1.99                                          CGSWindowID wid,
   1.100                                          CGSWindowLevel *level);
   1.101 -                                        
   1.102 -extern CGSError CGSDisplayHWFill (CGDirectDisplayID id, unsigned int x, unsigned int y, 
   1.103 -                      unsigned int w, unsigned int h, unsigned int color);
   1.104 +
   1.105 +extern CGSError CGSDisplayHWFill (CGDirectDisplayID id, unsigned int x, unsigned int y,
   1.106 +                                  unsigned int w, unsigned int h, unsigned int color);
   1.107  
   1.108  extern CGSError CGSDisplayCanHWFill (CGDirectDisplayID id);
   1.109  
   1.110 @@ -182,16 +198,16 @@
   1.111  /* Initialization, Query, Setup, and Redrawing functions */
   1.112  static int          QZ_VideoInit        (_THIS, SDL_PixelFormat *video_format);
   1.113  
   1.114 -static SDL_Rect**   QZ_ListModes        (_THIS, SDL_PixelFormat *format, 
   1.115 -					 Uint32 flags);
   1.116 +static SDL_Rect**   QZ_ListModes        (_THIS, SDL_PixelFormat *format,
   1.117 +                                         Uint32 flags);
   1.118  static void         QZ_UnsetVideoMode   (_THIS);
   1.119  
   1.120 -static SDL_Surface* QZ_SetVideoMode     (_THIS, SDL_Surface *current, 
   1.121 -					 int width, int height, int bpp, 
   1.122 -					 Uint32 flags);
   1.123 +static SDL_Surface* QZ_SetVideoMode     (_THIS, SDL_Surface *current,
   1.124 +                                         int width, int height, int bpp,
   1.125 +                                         Uint32 flags);
   1.126  static int          QZ_ToggleFullScreen (_THIS, int on);
   1.127 -static int          QZ_SetColors        (_THIS, int first_color, 
   1.128 -					 int num_colors, SDL_Color *colors);
   1.129 +static int          QZ_SetColors        (_THIS, int first_color,
   1.130 +                                         int num_colors, SDL_Color *colors);
   1.131  static void         QZ_DirectUpdate     (_THIS, int num_rects, SDL_Rect *rects);
   1.132  static void         QZ_UpdateRects      (_THIS, int num_rects, SDL_Rect *rects);
   1.133  static void         QZ_VideoQuit        (_THIS);
   1.134 @@ -223,8 +239,8 @@
   1.135  
   1.136  /* Cursor and Mouse functions */
   1.137  static void         QZ_FreeWMCursor     (_THIS, WMcursor *cursor);
   1.138 -static WMcursor*    QZ_CreateWMCursor   (_THIS, Uint8 *data, Uint8 *mask, 
   1.139 -                                          int w, int h, int hot_x, int hot_y);
   1.140 +static WMcursor*    QZ_CreateWMCursor   (_THIS, Uint8 *data, Uint8 *mask,
   1.141 +                                         int w, int h, int hot_x, int hot_y);
   1.142  static int          QZ_ShowWMCursor     (_THIS, WMcursor *cursor);
   1.143  static void         QZ_WarpWMCursor     (_THIS, Uint16 x, Uint16 y);
   1.144  static void         QZ_MoveWMCursor     (_THIS, int x, int y);
   1.145 @@ -241,3 +257,7 @@
   1.146  static SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode);
   1.147  /*static int  QZ_GetWMInfo     (_THIS, SDL_SysWMinfo *info);*/
   1.148  
   1.149 +/* YUV functions */
   1.150 +static SDL_Overlay* QZ_CreateYUVOverlay (_THIS, int width, int height,
   1.151 +                                         Uint32 format, SDL_Surface *display);
   1.152 +