src/video/quartz/SDL_QuartzVideo.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 20 Apr 2003 05:41:16 +0000
changeset 615 7ec821f3cbd0
parent 588 2c6510c0a304
child 656 864e2d2a9a55
permissions -rw-r--r--
Date: Thu, 17 Apr 2003 23:27:34 -0400
From: Darrell Walisser
Subject: Yet another OS X cursor bug

The synopsis:

1. Call SDL_ShowCursor(0);
2. Call SDL_SetVideoMode();
3. Call SDL_GetEvent();
3. Call SDL_ShowCursor(1);

The result: Sometimes the cursor doesn't come back! Ack! Oddly enough,
it does come back when mousing over the dock or clicking in the menu
bar. But that's besides the point.

The reason why this is happening is a flaw in the handling of
activation/deactivation events. The short explanation is that the
HideCursor() and ShowCursor() calls must be balanced, but if the cursor
was initially hidden, HideCursor() was called again on the activate
event - so now the next ShowCursor() fails (as does the next, and the
next, for some reason).

So, here's the patch. All it does is keep track of the
HideCursor()/ShowCursor() calls so that they will always be balanced.
slouken@47
     1
/*
slouken@47
     2
    SDL - Simple DirectMedia Layer
slouken@297
     3
    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  Sam Lantinga
slouken@47
     4
slouken@47
     5
    This library is free software; you can redistribute it and/or
slouken@47
     6
    modify it under the terms of the GNU Library General Public
slouken@47
     7
    License as published by the Free Software Foundation; either
slouken@47
     8
    version 2 of the License, or (at your option) any later version.
slouken@47
     9
slouken@47
    10
    This library is distributed in the hope that it will be useful,
slouken@47
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@47
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@47
    13
    Library General Public License for more details.
slouken@47
    14
slouken@47
    15
    You should have received a copy of the GNU Library General Public
slouken@47
    16
    License along with this library; if not, write to the Free
slouken@47
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@47
    18
slouken@47
    19
    Sam Lantinga
slouken@252
    20
    slouken@libsdl.org
slouken@47
    21
*/
slouken@47
    22
slouken@390
    23
/*    
slouken@47
    24
    @file   SDL_QuartzVideo.h
slouken@501
    25
    @author Darrell Walisser, Max Horn, et al.
slouken@47
    26
    
slouken@501
    27
    @abstract SDL video driver for Mac OS X.
slouken@47
    28
    
slouken@47
    29
    @discussion
slouken@47
    30
    
slouken@47
    31
    TODO
slouken@47
    32
        - Hardware Cursor support with NSCursor instead of Carbon
slouken@47
    33
        - Keyboard repeat/mouse speed adjust (if needed)
slouken@47
    34
        - Multiple monitor support (currently only main display)
slouken@47
    35
        - Accelerated blitting support
slouken@501
    36
        - Fix white OpenGL window on minimize (fixed) (update: broken again on 10.2)
slouken@501
    37
        - Find out what events should be sent/ignored if window is minimized
slouken@390
    38
        - Find a way to deal with external resolution/depth switch while app is running
slouken@501
    39
        - Resizeable windows (done)
slouken@272
    40
        - Check accuracy of QZ_SetGamma()
slouken@47
    41
    Problems:
slouken@47
    42
        - OGL not working in full screen with software renderer
slouken@47
    43
        - SetColors sets palette correctly but clears framebuffer
slouken@390
    44
        - Crash in CG after several mode switches (I think this has been fixed)
slouken@272
    45
        - Retained windows don't draw their title bar quite right (OS Bug) (not using retained windows)
slouken@501
    46
        - Cursor in 8 bit modes is screwy (might just be Radeon PCI bug) (update: not just Radeon)
slouken@272
    47
        - Warping cursor delays mouse events for a fraction of a second,
slouken@272
    48
          there is a hack around this that helps a bit
slouken@47
    49
*/
slouken@47
    50
slouken@272
    51
#include <Cocoa/Cocoa.h>
slouken@47
    52
#include <OpenGL/OpenGL.h>
slouken@47
    53
#include <Carbon/Carbon.h>
slouken@390
    54
#include <QuickTime/QuickTime.h>
slouken@561
    55
#include <IOKit/IOKitLib.h>	/* For powersave handling */
slouken@588
    56
#include <pthread.h>
slouken@47
    57
slouken@588
    58
#include "SDL_thread.h"
slouken@47
    59
#include "SDL_video.h"
slouken@47
    60
#include "SDL_error.h"
slouken@272
    61
#include "SDL_timer.h"
slouken@47
    62
#include "SDL_syswm.h"
slouken@47
    63
#include "SDL_sysvideo.h"
slouken@47
    64
#include "SDL_pixels_c.h"
slouken@47
    65
#include "SDL_events_c.h"
slouken@47
    66
slouken@435
    67
/* 
slouken@501
    68
    Add methods to get at private members of NSScreen. 
slouken@501
    69
    Since there is a bug in Apple's screen switching code
slouken@501
    70
    that does not update this variable when switching
slouken@501
    71
    to fullscreen, we'll set it manually (but only for the
slouken@501
    72
    main screen).
slouken@435
    73
*/
slouken@435
    74
@interface NSScreen (NSScreenAccess)
slouken@435
    75
- (void) setFrame:(NSRect)frame;
slouken@435
    76
@end
slouken@435
    77
slouken@435
    78
@implementation NSScreen (NSScreenAccess)
slouken@435
    79
- (void) setFrame:(NSRect)frame;
slouken@435
    80
{
slouken@435
    81
    _frame = frame;
slouken@435
    82
}
slouken@435
    83
@end
slouken@435
    84
slouken@501
    85
/* 
slouken@501
    86
    This is a workaround to directly access NSOpenGLContext's CGL context
slouken@501
    87
    We need this to check for errors NSOpenGLContext doesn't support
slouken@501
    88
*/
slouken@47
    89
@interface NSOpenGLContext (CGLContextAccess)
slouken@47
    90
- (CGLContextObj) cglContext;
slouken@47
    91
@end
slouken@47
    92
slouken@47
    93
@implementation NSOpenGLContext (CGLContextAccess)
slouken@47
    94
- (CGLContextObj) cglContext;
slouken@47
    95
{
slouken@47
    96
    return _contextAuxiliary;
slouken@47
    97
}
slouken@47
    98
@end
slouken@47
    99
slouken@501
   100
/* 
slouken@501
   101
    Structure for rez switch gamma fades
slouken@501
   102
    We can hide the monitor flicker by setting the gamma tables to 0
slouken@501
   103
*/
slouken@272
   104
#define QZ_GAMMA_TABLE_SIZE 256
slouken@272
   105
slouken@272
   106
typedef struct {
slouken@272
   107
slouken@272
   108
    CGGammaValue red[QZ_GAMMA_TABLE_SIZE];
slouken@272
   109
    CGGammaValue green[QZ_GAMMA_TABLE_SIZE];
slouken@272
   110
    CGGammaValue blue[QZ_GAMMA_TABLE_SIZE];
slouken@272
   111
slouken@272
   112
} SDL_QuartzGammaTable;
slouken@272
   113
slouken@272
   114
/* Main driver structure to store required state information */
slouken@47
   115
typedef struct SDL_PrivateVideoData {
slouken@47
   116
slouken@272
   117
    CGDirectDisplayID  display;            /* 0 == main display (only support single display) */
slouken@272
   118
    CFDictionaryRef    mode;               /* current mode of the display */
slouken@272
   119
    CFDictionaryRef    save_mode;          /* original mode of the display */
slouken@272
   120
    CFArrayRef         mode_list;          /* list of available fullscreen modes */
slouken@272
   121
    CGDirectPaletteRef palette;            /* palette of an 8-bit display */
slouken@501
   122
    NSOpenGLContext    *gl_context;        /* OpenGL rendering context */
slouken@272
   123
    Uint32             width, height, bpp; /* frequently used data about the display */
slouken@501
   124
    Uint32             flags;              /* flags for current mode, for teardown purposes */
slouken@272
   125
    Uint32             video_set;          /* boolean; indicates if video was set correctly */
slouken@272
   126
    Uint32             warp_flag;          /* boolean; notify to event loop that a warp just occured */
slouken@272
   127
    Uint32             warp_ticks;         /* timestamp when the warp occured */
slouken@272
   128
    NSWindow           *window;            /* Cocoa window to implement the SDL window */
slouken@501
   129
    NSQuickDrawView    *view;              /* the window's view; draw 2D and OpenGL into this view */
slouken@501
   130
    SDL_Surface        *resize_icon;       /* icon for the resize badge, we have to draw it by hand */
slouken@501
   131
    SDL_GrabMode       current_grab_mode;  /* default value is SDL_GRAB_OFF */
slouken@501
   132
    BOOL               in_foreground;      /* boolean; indicate if app is in foreground or not */
slouken@501
   133
    SDL_Rect           **client_mode_list; /* resolution list to pass back to client */
slouken@501
   134
    SDLKey             keymap[256];        /* Mac OS X to SDL key mapping */
slouken@501
   135
    Uint32             current_mods;       /* current keyboard modifiers, to track modifier state */
slouken@501
   136
    Uint32             last_virtual_button;/* last virtual mouse button pressed */
icculus@563
   137
    io_connect_t       power_connection;   /* used with IOKit to detect wake from sleep */
icculus@563
   138
    Uint8              expect_mouse_up;    /* used to determine when to send mouse up events */
icculus@563
   139
    Uint8              grab_state;         /* used to manage grab behavior */
icculus@563
   140
    NSPoint            cursor_loc;         /* saved cursor coords, for activate/deactivate when grabbed */
slouken@615
   141
    BOOL          	   cursor_visible;     /* tells if cursor was instructed to be hidden or not (SDL_ShowCursor) */
slouken@615
   142
    BOOL               cursor_hidden;      /* tells if cursor is *actually* hidden or not */
slouken@588
   143
    Uint8*             sw_buffers[2];      /* pointers to the two software buffers for double-buffer emulation */
slouken@588
   144
    SDL_Thread         *thread;            /* thread for async updates to the screen */
slouken@588
   145
    SDL_sem            *sem1, *sem2;       /* synchronization for async screen updates */
slouken@588
   146
    Uint8              *current_buffer;    /* the buffer being copied to the screen */
slouken@588
   147
    BOOL               quit_thread;        /* used to quit the async blitting thread */
icculus@563
   148
    
slouken@390
   149
    ImageDescriptionHandle yuv_idh;
slouken@390
   150
    MatrixRecordPtr        yuv_matrix;
slouken@390
   151
    DecompressorComponent  yuv_codec;
slouken@390
   152
    ImageSequence          yuv_seq;
slouken@390
   153
    PlanarPixmapInfoYUV420 *yuv_pixmap;
slouken@390
   154
    Sint16                  yuv_width, yuv_height;
slouken@390
   155
    CGrafPtr                yuv_port;
slouken@390
   156
slouken@47
   157
} SDL_PrivateVideoData ;
slouken@47
   158
slouken@390
   159
#define _THIS    SDL_VideoDevice *this
slouken@47
   160
#define display_id (this->hidden->display)
slouken@47
   161
#define mode (this->hidden->mode)
slouken@47
   162
#define save_mode (this->hidden->save_mode)
slouken@47
   163
#define mode_list (this->hidden->mode_list)
slouken@47
   164
#define palette (this->hidden->palette)
slouken@47
   165
#define gl_context (this->hidden->gl_context)
slouken@47
   166
#define device_width (this->hidden->width)
slouken@47
   167
#define device_height (this->hidden->height)
slouken@47
   168
#define device_bpp (this->hidden->bpp)
slouken@47
   169
#define mode_flags (this->hidden->flags)
slouken@158
   170
#define qz_window (this->hidden->window)
slouken@272
   171
#define window_view (this->hidden->view)
slouken@272
   172
#define video_set (this->hidden->video_set)
slouken@272
   173
#define warp_ticks (this->hidden->warp_ticks)
slouken@272
   174
#define warp_flag (this->hidden->warp_flag)
slouken@501
   175
#define resize_icon (this->hidden->resize_icon)
slouken@501
   176
#define current_grab_mode (this->hidden->current_grab_mode)
slouken@501
   177
#define in_foreground (this->hidden->in_foreground)
slouken@501
   178
#define client_mode_list (this->hidden->client_mode_list)
slouken@501
   179
#define keymap (this->hidden->keymap)
slouken@501
   180
#define current_mods (this->hidden->current_mods)
slouken@501
   181
#define last_virtual_button (this->hidden->last_virtual_button)
icculus@563
   182
#define power_connection (this->hidden->power_connection)
icculus@563
   183
#define expect_mouse_up (this->hidden->expect_mouse_up)
icculus@563
   184
#define grab_state (this->hidden->grab_state)
icculus@563
   185
#define cursor_loc (this->hidden->cursor_loc)
icculus@563
   186
#define cursor_visible (this->hidden->cursor_visible)
slouken@615
   187
#define cursor_hidden (this->hidden->cursor_hidden)
slouken@588
   188
#define sw_buffers (this->hidden->sw_buffers)
slouken@588
   189
#define thread (this->hidden->thread)
slouken@588
   190
#define sem1 (this->hidden->sem1)
slouken@588
   191
#define sem2 (this->hidden->sem2)
slouken@588
   192
#define current_buffer (this->hidden->current_buffer)
slouken@588
   193
#define quit_thread (this->hidden->quit_thread)
slouken@501
   194
slouken@390
   195
#define yuv_idh (this->hidden->yuv_idh)
slouken@390
   196
#define yuv_matrix (this->hidden->yuv_matrix)
slouken@390
   197
#define yuv_codec (this->hidden->yuv_codec)
slouken@390
   198
#define yuv_seq (this->hidden->yuv_seq)
slouken@390
   199
#define yuv_pixmap (this->hidden->yuv_pixmap)
slouken@390
   200
#define yuv_data (this->hidden->yuv_data)
slouken@390
   201
#define yuv_width (this->hidden->yuv_width)
slouken@390
   202
#define yuv_height (this->hidden->yuv_height)
slouken@390
   203
#define yuv_port (this->hidden->yuv_port)
slouken@47
   204
icculus@563
   205
icculus@563
   206
/* grab states - the input is in one of these states */
icculus@563
   207
enum {
icculus@563
   208
    QZ_UNGRABBED = 0,
icculus@563
   209
    QZ_VISIBLE_GRAB,
icculus@563
   210
    QZ_INVISIBLE_GRAB
icculus@563
   211
};
icculus@563
   212
icculus@563
   213
/* grab actions - these can change the grabbed state */
icculus@563
   214
enum {
icculus@563
   215
    QZ_ENABLE_GRAB = 0,
icculus@563
   216
    QZ_DISABLE_GRAB,
icculus@563
   217
    QZ_HIDECURSOR,
icculus@563
   218
    QZ_SHOWCURSOR
icculus@563
   219
};
icculus@563
   220
slouken@501
   221
/* 
slouken@501
   222
    Obscuring code: maximum number of windows above ours (inclusive) 
slouken@501
   223
    
slouken@501
   224
    Note: this doesn't work too well in practice and should be
slouken@501
   225
    phased out when we add OpenGL 2D acceleration. It was never
slouken@501
   226
    enabled in the first place, so this shouldn't be a problem ;-)
slouken@501
   227
*/
slouken@272
   228
#define kMaxWindows 256
slouken@272
   229
slouken@272
   230
/* Some of the Core Graphics Server API for obscuring code */
slouken@272
   231
#define kCGSWindowLevelTop          2147483632
slouken@272
   232
#define kCGSWindowLevelDockIconDrag 500
slouken@272
   233
#define kCGSWindowLevelDockMenu     101
slouken@272
   234
#define kCGSWindowLevelMenuIgnore    21
slouken@272
   235
#define kCGSWindowLevelMenu          20
slouken@272
   236
#define kCGSWindowLevelDockLabel     12
slouken@272
   237
#define kCGSWindowLevelDockIcon      11
slouken@272
   238
#define kCGSWindowLevelDock          10
slouken@272
   239
#define kCGSWindowLevelUtility        3
slouken@272
   240
#define kCGSWindowLevelNormal         0
slouken@272
   241
slouken@501
   242
/* 
slouken@501
   243
    For completeness; We never use these window levels, they are always below us
slouken@501
   244
    #define kCGSWindowLevelMBarShadow -20
slouken@501
   245
    #define kCGSWindowLevelDesktopPicture -2147483647
slouken@501
   246
    #define kCGSWindowLevelDesktop        -2147483648
slouken@272
   247
*/
slouken@272
   248
slouken@272
   249
typedef CGError       CGSError;
slouken@390
   250
typedef long          CGSWindowCount;
slouken@390
   251
typedef void *        CGSConnectionID;
slouken@390
   252
typedef int           CGSWindowID;
slouken@272
   253
typedef CGSWindowID*  CGSWindowIDList;
slouken@272
   254
typedef CGWindowLevel CGSWindowLevel;
slouken@272
   255
typedef NSRect        CGSRect;
slouken@272
   256
slouken@272
   257
extern CGSConnectionID _CGSDefaultConnection ();
slouken@272
   258
slouken@390
   259
extern CGSError CGSGetOnScreenWindowList (CGSConnectionID cid,
slouken@272
   260
                                          CGSConnectionID owner,
slouken@272
   261
                                          CGSWindowCount listCapacity,
slouken@272
   262
                                          CGSWindowIDList list,
slouken@272
   263
                                          CGSWindowCount *listCount);
slouken@272
   264
slouken@272
   265
extern CGSError CGSGetScreenRectForWindow (CGSConnectionID cid,
slouken@272
   266
                                           CGSWindowID wid,
slouken@272
   267
                                           CGSRect *rect);
slouken@272
   268
slouken@272
   269
extern CGWindowLevel CGSGetWindowLevel (CGSConnectionID cid,
slouken@272
   270
                                        CGSWindowID wid,
slouken@272
   271
                                        CGSWindowLevel *level);
slouken@390
   272
slouken@390
   273
extern CGSError CGSDisplayHWFill (CGDirectDisplayID id, unsigned int x, unsigned int y,
slouken@390
   274
                                  unsigned int w, unsigned int h, unsigned int color);
slouken@272
   275
slouken@272
   276
extern CGSError CGSDisplayCanHWFill (CGDirectDisplayID id);
slouken@272
   277
slouken@272
   278
extern CGSError CGSGetMouseEnabledFlags (CGSConnectionID cid, CGSWindowID wid, int *flags);
slouken@47
   279
slouken@588
   280
int CGSDisplayHWSync (CGDirectDisplayID id);
slouken@588
   281
slouken@47
   282
/* Bootstrap functions */
slouken@47
   283
static int              QZ_Available ();
slouken@47
   284
static SDL_VideoDevice* QZ_CreateDevice (int device_index);
slouken@47
   285
static void             QZ_DeleteDevice (SDL_VideoDevice *device);
slouken@47
   286
slouken@47
   287
/* Initialization, Query, Setup, and Redrawing functions */
slouken@47
   288
static int          QZ_VideoInit        (_THIS, SDL_PixelFormat *video_format);
slouken@47
   289
slouken@390
   290
static SDL_Rect**   QZ_ListModes        (_THIS, SDL_PixelFormat *format,
slouken@390
   291
                                         Uint32 flags);
slouken@47
   292
static void         QZ_UnsetVideoMode   (_THIS);
slouken@47
   293
slouken@390
   294
static SDL_Surface* QZ_SetVideoMode     (_THIS, SDL_Surface *current,
slouken@390
   295
                                         int width, int height, int bpp,
slouken@390
   296
                                         Uint32 flags);
slouken@47
   297
static int          QZ_ToggleFullScreen (_THIS, int on);
slouken@390
   298
static int          QZ_SetColors        (_THIS, int first_color,
slouken@390
   299
                                         int num_colors, SDL_Color *colors);
slouken@588
   300
slouken@588
   301
static int          QZ_LockDoubleBuffer   (_THIS, SDL_Surface *surface);
slouken@588
   302
static void         QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface);
slouken@588
   303
static int          QZ_ThreadFlip         (_THIS);
slouken@588
   304
static int          QZ_FlipDoubleBuffer   (_THIS, SDL_Surface *surface);
slouken@588
   305
static void         QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect *rects);
slouken@588
   306
slouken@47
   307
static void         QZ_DirectUpdate     (_THIS, int num_rects, SDL_Rect *rects);
slouken@501
   308
static int          QZ_LockWindow       (_THIS, SDL_Surface *surface);
slouken@498
   309
static void         QZ_UnlockWindow     (_THIS, SDL_Surface *surface);
slouken@47
   310
static void         QZ_UpdateRects      (_THIS, int num_rects, SDL_Rect *rects);
slouken@47
   311
static void         QZ_VideoQuit        (_THIS);
slouken@47
   312
slouken@47
   313
/* Hardware surface functions (for fullscreen mode only) */
slouken@47
   314
static int  QZ_FillHWRect (_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color);
slouken@47
   315
static int  QZ_LockHWSurface(_THIS, SDL_Surface *surface);
slouken@47
   316
static void QZ_UnlockHWSurface(_THIS, SDL_Surface *surface);
slouken@47
   317
static void QZ_FreeHWSurface (_THIS, SDL_Surface *surface);
slouken@47
   318
/* static int  QZ_FlipHWSurface (_THIS, SDL_Surface *surface); */
slouken@47
   319
slouken@47
   320
/* Gamma Functions */
slouken@47
   321
static int QZ_SetGamma     (_THIS, float red, float green, float blue);
slouken@47
   322
static int QZ_GetGamma     (_THIS, float *red, float *green, float *blue);
slouken@47
   323
static int QZ_SetGammaRamp (_THIS, Uint16 *ramp);
slouken@47
   324
static int QZ_GetGammaRamp (_THIS, Uint16 *ramp);
slouken@47
   325
slouken@47
   326
/* OpenGL functions */
slouken@501
   327
static int    QZ_SetupOpenGL       (_THIS, int bpp, Uint32 flags);
slouken@501
   328
static void   QZ_TearDownOpenGL    (_THIS);
slouken@47
   329
static void*  QZ_GL_GetProcAddress (_THIS, const char *proc);
slouken@47
   330
static int    QZ_GL_GetAttribute   (_THIS, SDL_GLattr attrib, int* value);
slouken@47
   331
static int    QZ_GL_MakeCurrent    (_THIS);
slouken@47
   332
static void   QZ_GL_SwapBuffers    (_THIS);
slouken@47
   333
static int    QZ_GL_LoadLibrary    (_THIS, const char *location);
slouken@47
   334
slouken@47
   335
/* Private function to warp the cursor (used internally) */
slouken@272
   336
static void  QZ_PrivateWarpCursor (_THIS, int x, int y);
slouken@47
   337
slouken@47
   338
/* Cursor and Mouse functions */
slouken@47
   339
static void         QZ_FreeWMCursor     (_THIS, WMcursor *cursor);
slouken@390
   340
static WMcursor*    QZ_CreateWMCursor   (_THIS, Uint8 *data, Uint8 *mask,
slouken@390
   341
                                         int w, int h, int hot_x, int hot_y);
slouken@47
   342
static int          QZ_ShowWMCursor     (_THIS, WMcursor *cursor);
slouken@47
   343
static void         QZ_WarpWMCursor     (_THIS, Uint16 x, Uint16 y);
slouken@47
   344
static void         QZ_MoveWMCursor     (_THIS, int x, int y);
slouken@47
   345
static void         QZ_CheckMouseMode   (_THIS);
slouken@47
   346
slouken@47
   347
/* Event functions */
slouken@47
   348
static void         QZ_InitOSKeymap     (_THIS);
slouken@47
   349
static void         QZ_PumpEvents       (_THIS);
slouken@47
   350
slouken@47
   351
/* Window Manager functions */
slouken@501
   352
static void QZ_SetCaption        (_THIS, const char *title, const char *icon);
slouken@501
   353
static void QZ_SetIcon           (_THIS, SDL_Surface *icon, Uint8 *mask);
slouken@501
   354
static int  QZ_IconifyWindow     (_THIS);
slouken@47
   355
static SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode);
slouken@47
   356
/*static int  QZ_GetWMInfo     (_THIS, SDL_SysWMinfo *info);*/
slouken@272
   357
slouken@390
   358
/* YUV functions */
slouken@390
   359
static SDL_Overlay* QZ_CreateYUVOverlay (_THIS, int width, int height,
slouken@561
   360
                                         Uint32 format, SDL_Surface *display);