Commit aba4b443 authored by Sam Lantinga's avatar Sam Lantinga

Date: Sat, 1 Jun 2002 17:56:45 -0500

From: Darrell Walisser <dwaliss1@purdue.edu>
Subject: mac patch

In this patch:

- yuv code
- links to QuickTime
- tabs -> 4 spaces
- mouse events fix
- SDLMain path parsing fix
- BUGS updates
- some miscellaneous docs/comments/code cleanup

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40391
parent 455d014f
...@@ -72,26 +72,20 @@ MacOS X: ...@@ -72,26 +72,20 @@ MacOS X:
Joystick code is not extensively tested yet. Joystick code is not extensively tested yet.
Window may not close when unsetting video mode and resetting.
Resizeable windows aren't implemented yet. Resizeable windows aren't implemented yet.
Depth switching for windowed mode isn't implemented yet. Depth switching for windowed mode isn't implemented yet.
Palette handling isn't implemented in windowed mode yet. Palette handling isn't implemented in windowed mode yet.
Command-line arguments Dialog is not implemented yet. Command-line arguments dialog is not implemented yet.
Fullscreen drawing has some artifacts. Fullscreen drawing has some artifacts.
Fullscreen window covers *all* other windows - even force quit.
Fullscreen OpenGL for the software renderer is broken. Fullscreen OpenGL for the software renderer is broken.
Some OpenGL parameters are not accounted for, for example color bits customization. Some OpenGL parameters are not accounted for, for example color bits customization.
Getting OpenGL context parameters is not implemented.
Continuous mouse motion perhaps is not as smooth as it should be. Continuous mouse motion perhaps is not as smooth as it should be.
SDL_WM_GrabInput() is implemented, but it "freezes" the hardware SDL_WM_GrabInput() is implemented, but it "freezes" the hardware
......
...@@ -51,24 +51,25 @@ static BOOL gFinderLaunch; ...@@ -51,24 +51,25 @@ static BOOL gFinderLaunch;
/* Set the working directory to the .app's parent directory */ /* Set the working directory to the .app's parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir - (void) setupWorkingDirectory:(BOOL)shouldChdir
{ {
char parentdir[MAXPATHLEN];
char *c;
strncpy ( parentdir, gArgv[0], sizeof(parentdir) );
c = (char*) parentdir;
while (*c != '\0') /* go to end */
c++;
while (*c != '/') /* back up to parent */
c--;
*c++ = '\0'; /* cut off last part (binary name) */
if (shouldChdir) if (shouldChdir)
{ {
assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ char parentdir[MAXPATHLEN];
assert ( chdir ("../../../") == 0 ); /* chdir to the .app's parent */ char *c;
strncpy ( parentdir, gArgv[0], sizeof(parentdir) );
c = (char*) parentdir;
while (*c != '\0') /* go to end */
c++;
while (*c != '/') /* back up to parent */
c--;
*c++ = '\0'; /* cut off last part (binary name) */
assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
assert ( chdir ("../../../") == 0 ); /* chdir to the .app's parent */
} }
} }
......
This diff is collapsed.
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. Library General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* These are the Macintosh key scancode constants -- from Inside Macintosh */ /* These are the Macintosh key scancode constants -- from Inside Macintosh */
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
#define QZ_F11 0x67 #define QZ_F11 0x67
#define QZ_F12 0x6F #define QZ_F12 0x6F
#define QZ_PRINT 0x69 #define QZ_PRINT 0x69
#define QZ_SCROLLOCK 0x6B #define QZ_SCROLLOCK 0x6B
#define QZ_PAUSE 0x71 #define QZ_PAUSE 0x71
#define QZ_POWER 0x7F #define QZ_POWER 0x7F
#define QZ_BACKQUOTE 0x32 #define QZ_BACKQUOTE 0x32
#define QZ_1 0x12 #define QZ_1 0x12
#define QZ_2 0x13 #define QZ_2 0x13
#define QZ_3 0x14 #define QZ_3 0x14
...@@ -52,14 +52,14 @@ ...@@ -52,14 +52,14 @@
#define QZ_0 0x1D #define QZ_0 0x1D
#define QZ_MINUS 0x1B #define QZ_MINUS 0x1B
#define QZ_EQUALS 0x18 #define QZ_EQUALS 0x18
#define QZ_BACKSPACE 0x33 #define QZ_BACKSPACE 0x33
#define QZ_INSERT 0x72 #define QZ_INSERT 0x72
#define QZ_HOME 0x73 #define QZ_HOME 0x73
#define QZ_PAGEUP 0x74 #define QZ_PAGEUP 0x74
#define QZ_NUMLOCK 0x47 #define QZ_NUMLOCK 0x47
#define QZ_KP_EQUALS 0x51 #define QZ_KP_EQUALS 0x51
#define QZ_KP_DIVIDE 0x4B #define QZ_KP_DIVIDE 0x4B
#define QZ_KP_MULTIPLY 0x43 #define QZ_KP_MULTIPLY 0x43
#define QZ_TAB 0x30 #define QZ_TAB 0x30
#define QZ_q 0x0C #define QZ_q 0x0C
#define QZ_w 0x0D #define QZ_w 0x0D
...@@ -71,9 +71,9 @@ ...@@ -71,9 +71,9 @@
#define QZ_i 0x22 #define QZ_i 0x22
#define QZ_o 0x1F #define QZ_o 0x1F
#define QZ_p 0x23 #define QZ_p 0x23
#define QZ_LEFTBRACKET 0x21 #define QZ_LEFTBRACKET 0x21
#define QZ_RIGHTBRACKET 0x1E #define QZ_RIGHTBRACKET 0x1E
#define QZ_BACKSLASH 0x2A #define QZ_BACKSLASH 0x2A
#define QZ_DELETE 0x75 #define QZ_DELETE 0x75
#define QZ_END 0x77 #define QZ_END 0x77
#define QZ_PAGEDOWN 0x79 #define QZ_PAGEDOWN 0x79
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
#define QZ_j 0x26 #define QZ_j 0x26
#define QZ_k 0x28 #define QZ_k 0x28
#define QZ_l 0x25 #define QZ_l 0x25
#define QZ_SEMICOLON 0x29 #define QZ_SEMICOLON 0x29
#define QZ_QUOTE 0x27 #define QZ_QUOTE 0x27
#define QZ_RETURN 0x24 #define QZ_RETURN 0x24
#define QZ_KP4 0x56 #define QZ_KP4 0x56
...@@ -130,11 +130,11 @@ ...@@ -130,11 +130,11 @@
#define QZ_DOWN 0x7D #define QZ_DOWN 0x7D
#define QZ_RIGHT 0x7C #define QZ_RIGHT 0x7C
#define QZ_KP0 0x52 #define QZ_KP0 0x52
#define QZ_KP_PERIOD 0x41 #define QZ_KP_PERIOD 0x41
/* Wierd, these keys are on my iBook under MacOS X */ /* Wierd, these keys are on my iBook under MacOS X */
#define QZ_IBOOK_ENTER 0x34 #define QZ_IBOOK_ENTER 0x34
#define QZ_IBOOK_LEFT 0x3B #define QZ_IBOOK_LEFT 0x3B
#define QZ_IBOOK_RIGHT 0x3C #define QZ_IBOOK_RIGHT 0x3C
#define QZ_IBOOK_DOWN 0x3D #define QZ_IBOOK_DOWN 0x3D
#define QZ_IBOOK_UP 0x3E #define QZ_IBOOK_UP 0x3E
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
slouken@libsdl.org slouken@libsdl.org
*/ */
/* /*
@file SDL_QuartzVideo.h @file SDL_QuartzVideo.h
@author Darrell Walisser @author Darrell Walisser
...@@ -33,16 +33,15 @@ ...@@ -33,16 +33,15 @@
- Keyboard repeat/mouse speed adjust (if needed) - Keyboard repeat/mouse speed adjust (if needed)
- Multiple monitor support (currently only main display) - Multiple monitor support (currently only main display)
- Accelerated blitting support - Accelerated blitting support
- Set the window icon (dock icon when API is available) - Fix white OpenGL window on minimize (fixed)
- Fix white OpenGL window on minimize
- Find out what events should be sent/ignored if window is mimimized - Find out what events should be sent/ignored if window is mimimized
- Find a better way to deal with resolution/depth switch while app is running - Find a way to deal with external resolution/depth switch while app is running
- Resizeable windows - Resizeable windows
- Check accuracy of QZ_SetGamma() - Check accuracy of QZ_SetGamma()
Problems: Problems:
- OGL not working in full screen with software renderer - OGL not working in full screen with software renderer
- SetColors sets palette correctly but clears framebuffer - SetColors sets palette correctly but clears framebuffer
- Crash in CG after several mode switches - Crash in CG after several mode switches (I think this has been fixed)
- Retained windows don't draw their title bar quite right (OS Bug) (not using retained windows) - Retained windows don't draw their title bar quite right (OS Bug) (not using retained windows)
- Cursor in 8 bit modes is screwy (might just be Radeon PCI bug) - Cursor in 8 bit modes is screwy (might just be Radeon PCI bug)
- Warping cursor delays mouse events for a fraction of a second, - Warping cursor delays mouse events for a fraction of a second,
...@@ -52,6 +51,7 @@ ...@@ -52,6 +51,7 @@
#include <Cocoa/Cocoa.h> #include <Cocoa/Cocoa.h>
#include <OpenGL/OpenGL.h> #include <OpenGL/OpenGL.h>
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#include <QuickTime/QuickTime.h>
#include "SDL_video.h" #include "SDL_video.h"
#include "SDL_error.h" #include "SDL_error.h"
...@@ -102,10 +102,17 @@ typedef struct SDL_PrivateVideoData { ...@@ -102,10 +102,17 @@ typedef struct SDL_PrivateVideoData {
Uint32 warp_ticks; /* timestamp when the warp occured */ Uint32 warp_ticks; /* timestamp when the warp occured */
NSWindow *window; /* Cocoa window to implement the SDL window */ NSWindow *window; /* Cocoa window to implement the SDL window */
NSQuickDrawView *view; /* the window's view; draw 2D into this view */ NSQuickDrawView *view; /* the window's view; draw 2D into this view */
ImageDescriptionHandle yuv_idh;
MatrixRecordPtr yuv_matrix;
DecompressorComponent yuv_codec;
ImageSequence yuv_seq;
PlanarPixmapInfoYUV420 *yuv_pixmap;
Sint16 yuv_width, yuv_height;
CGrafPtr yuv_port;
} SDL_PrivateVideoData ; } SDL_PrivateVideoData ;
#define _THIS SDL_VideoDevice *this #define _THIS SDL_VideoDevice *this
#define display_id (this->hidden->display) #define display_id (this->hidden->display)
#define mode (this->hidden->mode) #define mode (this->hidden->mode)
#define save_mode (this->hidden->save_mode) #define save_mode (this->hidden->save_mode)
...@@ -121,6 +128,15 @@ typedef struct SDL_PrivateVideoData { ...@@ -121,6 +128,15 @@ typedef struct SDL_PrivateVideoData {
#define video_set (this->hidden->video_set) #define video_set (this->hidden->video_set)
#define warp_ticks (this->hidden->warp_ticks) #define warp_ticks (this->hidden->warp_ticks)
#define warp_flag (this->hidden->warp_flag) #define warp_flag (this->hidden->warp_flag)
#define yuv_idh (this->hidden->yuv_idh)
#define yuv_matrix (this->hidden->yuv_matrix)
#define yuv_codec (this->hidden->yuv_codec)
#define yuv_seq (this->hidden->yuv_seq)
#define yuv_pixmap (this->hidden->yuv_pixmap)
#define yuv_data (this->hidden->yuv_data)
#define yuv_width (this->hidden->yuv_width)
#define yuv_height (this->hidden->yuv_height)
#define yuv_port (this->hidden->yuv_port)
/* Obscuring code: maximum number of windows above ours (inclusive) */ /* Obscuring code: maximum number of windows above ours (inclusive) */
#define kMaxWindows 256 #define kMaxWindows 256
...@@ -144,16 +160,16 @@ typedef struct SDL_PrivateVideoData { ...@@ -144,16 +160,16 @@ typedef struct SDL_PrivateVideoData {
*/ */
typedef CGError CGSError; typedef CGError CGSError;
typedef long CGSWindowCount; typedef long CGSWindowCount;
typedef void * CGSConnectionID; typedef void * CGSConnectionID;
typedef int CGSWindowID; typedef int CGSWindowID;
typedef CGSWindowID* CGSWindowIDList; typedef CGSWindowID* CGSWindowIDList;
typedef CGWindowLevel CGSWindowLevel; typedef CGWindowLevel CGSWindowLevel;
typedef NSRect CGSRect; typedef NSRect CGSRect;
extern CGSConnectionID _CGSDefaultConnection (); extern CGSConnectionID _CGSDefaultConnection ();
extern CGSError CGSGetOnScreenWindowList (CGSConnectionID cid, extern CGSError CGSGetOnScreenWindowList (CGSConnectionID cid,
CGSConnectionID owner, CGSConnectionID owner,
CGSWindowCount listCapacity, CGSWindowCount listCapacity,
CGSWindowIDList list, CGSWindowIDList list,
...@@ -166,9 +182,9 @@ extern CGSError CGSGetScreenRectForWindow (CGSConnectionID cid, ...@@ -166,9 +182,9 @@ extern CGSError CGSGetScreenRectForWindow (CGSConnectionID cid,
extern CGWindowLevel CGSGetWindowLevel (CGSConnectionID cid, extern CGWindowLevel CGSGetWindowLevel (CGSConnectionID cid,
CGSWindowID wid, CGSWindowID wid,
CGSWindowLevel *level); CGSWindowLevel *level);
extern CGSError CGSDisplayHWFill (CGDirectDisplayID id, unsigned int x, unsigned int y, extern CGSError CGSDisplayHWFill (CGDirectDisplayID id, unsigned int x, unsigned int y,
unsigned int w, unsigned int h, unsigned int color); unsigned int w, unsigned int h, unsigned int color);
extern CGSError CGSDisplayCanHWFill (CGDirectDisplayID id); extern CGSError CGSDisplayCanHWFill (CGDirectDisplayID id);
...@@ -182,16 +198,16 @@ static void QZ_DeleteDevice (SDL_VideoDevice *device); ...@@ -182,16 +198,16 @@ static void QZ_DeleteDevice (SDL_VideoDevice *device);
/* Initialization, Query, Setup, and Redrawing functions */ /* Initialization, Query, Setup, and Redrawing functions */
static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format); static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format);
static SDL_Rect** QZ_ListModes (_THIS, SDL_PixelFormat *format, static SDL_Rect** QZ_ListModes (_THIS, SDL_PixelFormat *format,
Uint32 flags); Uint32 flags);
static void QZ_UnsetVideoMode (_THIS); static void QZ_UnsetVideoMode (_THIS);
static SDL_Surface* QZ_SetVideoMode (_THIS, SDL_Surface *current, static SDL_Surface* QZ_SetVideoMode (_THIS, SDL_Surface *current,
int width, int height, int bpp, int width, int height, int bpp,
Uint32 flags); Uint32 flags);
static int QZ_ToggleFullScreen (_THIS, int on); static int QZ_ToggleFullScreen (_THIS, int on);
static int QZ_SetColors (_THIS, int first_color, static int QZ_SetColors (_THIS, int first_color,
int num_colors, SDL_Color *colors); int num_colors, SDL_Color *colors);
static void QZ_DirectUpdate (_THIS, int num_rects, SDL_Rect *rects); static void QZ_DirectUpdate (_THIS, int num_rects, SDL_Rect *rects);
static void QZ_UpdateRects (_THIS, int num_rects, SDL_Rect *rects); static void QZ_UpdateRects (_THIS, int num_rects, SDL_Rect *rects);
static void QZ_VideoQuit (_THIS); static void QZ_VideoQuit (_THIS);
...@@ -223,8 +239,8 @@ static void QZ_PrivateWarpCursor (_THIS, int x, int y); ...@@ -223,8 +239,8 @@ static void QZ_PrivateWarpCursor (_THIS, int x, int y);
/* Cursor and Mouse functions */ /* Cursor and Mouse functions */
static void QZ_FreeWMCursor (_THIS, WMcursor *cursor); static void QZ_FreeWMCursor (_THIS, WMcursor *cursor);
static WMcursor* QZ_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask, static WMcursor* QZ_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask,
int w, int h, int hot_x, int hot_y); int w, int h, int hot_x, int hot_y);
static int QZ_ShowWMCursor (_THIS, WMcursor *cursor); static int QZ_ShowWMCursor (_THIS, WMcursor *cursor);
static void QZ_WarpWMCursor (_THIS, Uint16 x, Uint16 y); static void QZ_WarpWMCursor (_THIS, Uint16 x, Uint16 y);
static void QZ_MoveWMCursor (_THIS, int x, int y); static void QZ_MoveWMCursor (_THIS, int x, int y);
...@@ -241,3 +257,7 @@ static int QZ_IconifyWindow (_THIS); ...@@ -241,3 +257,7 @@ static int QZ_IconifyWindow (_THIS);
static SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode); static SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode);
/*static int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info);*/ /*static int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info);*/
/* YUV functions */
static SDL_Overlay* QZ_CreateYUVOverlay (_THIS, int width, int height,
Uint32 format, SDL_Surface *display);
This diff is collapsed.
...@@ -32,17 +32,17 @@ static void QZ_FreeWMCursor (_THIS, WMcursor *cursor) { ...@@ -32,17 +32,17 @@ static void QZ_FreeWMCursor (_THIS, WMcursor *cursor) {
/* Use the Carbon cursor routines for now */ /* Use the Carbon cursor routines for now */
static WMcursor* QZ_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask, static WMcursor* QZ_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask,
int w, int h, int hot_x, int hot_y) { int w, int h, int hot_x, int hot_y) {
WMcursor *cursor; WMcursor *cursor;
int row, bytes; int row, bytes;
/* Allocate the cursor memory */ /* Allocate the cursor memory */
cursor = (WMcursor *)malloc(sizeof(WMcursor)); cursor = (WMcursor *)malloc(sizeof(WMcursor));
if ( cursor == NULL ) { if ( cursor == NULL ) {
SDL_OutOfMemory(); SDL_OutOfMemory();
return(NULL); return(NULL);
} }
memset(cursor, 0, sizeof(*cursor)); memset(cursor, 0, sizeof(*cursor));
if (w > 16) if (w > 16)
w = 16; w = 16;
...@@ -50,19 +50,19 @@ static WMcursor* QZ_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask, ...@@ -50,19 +50,19 @@ static WMcursor* QZ_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask,
if (h > 16) if (h > 16)
h = 16; h = 16;
bytes = (w+7)/8; bytes = (w+7)/8;
for ( row=0; row<h; ++row ) { for ( row=0; row<h; ++row ) {
memcpy(&cursor->curs.data[row], data, bytes); memcpy(&cursor->curs.data[row], data, bytes);
data += bytes; data += bytes;
} }
for ( row=0; row<h; ++row ) { for ( row=0; row<h; ++row ) {
memcpy(&cursor->curs.mask[row], mask, bytes); memcpy(&cursor->curs.mask[row], mask, bytes);
mask += bytes; mask += bytes;
} }
cursor->curs.hotSpot.h = hot_x; cursor->curs.hotSpot.h = hot_x;
cursor->curs.hotSpot.v = hot_y; cursor->curs.hotSpot.v = hot_y;
return(cursor); return(cursor);
} }
...@@ -246,18 +246,18 @@ static void QZ_SetIcon (_THIS, SDL_Surface *icon, Uint8 *mask) ...@@ -246,18 +246,18 @@ static void QZ_SetIcon (_THIS, SDL_Surface *icon, Uint8 *mask)
#define ALPHASHIFT 3 #define ALPHASHIFT 3
for (i=0;i<masksize;i+=8) for (i=0;i<masksize;i+=8)
for (j=0;j<8;j++) for (j=0;j<8;j++)
surfPtr[ALPHASHIFT+((i+j)<<2)]=(mask[i>>3]&(1<<(7-j)))?0xFF:0x00; surfPtr[ALPHASHIFT+((i+j)<<2)]=(mask[i>>3]&(1<<(7-j)))?0xFF:0x00;
} }
imgrep = [[NSBitmapImageRep alloc] imgrep = [ [ NSBitmapImageRep alloc]
initWithBitmapDataPlanes:(unsigned char **)&mergedSurface->pixels initWithBitmapDataPlanes:(unsigned char **)&mergedSurface->pixels
pixelsWide:icon->w pixelsHigh:icon->h bitsPerSample:8 samplesPerPixel:4 pixelsWide:icon->w pixelsHigh:icon->h bitsPerSample:8 samplesPerPixel:4
hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace
bytesPerRow:icon->w<<2 bitsPerPixel:32]; bytesPerRow:icon->w<<2 bitsPerPixel:32 ];
img = [[NSImage alloc] initWithSize:imgSize]; img = [ [ NSImage alloc ] initWithSize:imgSize ];
[img addRepresentation: imgrep]; [ img addRepresentation: imgrep ];
[NSApp setApplicationIconImage:img]; [ NSApp setApplicationIconImage:img ];
[img release]; [ img release ];
[imgrep release]; [ imgrep release ];
SDL_FreeSurface(mergedSurface); SDL_FreeSurface(mergedSurface);
freePool: freePool:
[pool release]; [pool release];
...@@ -285,19 +285,18 @@ static int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info) { ...@@ -285,19 +285,18 @@ static int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info) {
static SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode) { static SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode) {
switch (grab_mode) { switch (grab_mode) {
case SDL_GRAB_QUERY: case SDL_GRAB_QUERY:
break; break;
case SDL_GRAB_OFF: case SDL_GRAB_OFF:
CGAssociateMouseAndMouseCursorPosition (1); CGAssociateMouseAndMouseCursorPosition (1);
currentGrabMode = SDL_GRAB_OFF; currentGrabMode = SDL_GRAB_OFF;
break; break;
case SDL_GRAB_ON: case SDL_GRAB_ON:
QZ_WarpWMCursor (this, SDL_VideoSurface->w / 2, SDL_VideoSurface->h / 2); QZ_WarpWMCursor (this, SDL_VideoSurface->w / 2, SDL_VideoSurface->h / 2);
CGAssociateMouseAndMouseCursorPosition (0); CGAssociateMouseAndMouseCursorPosition (0);
currentGrabMode = SDL_GRAB_ON; currentGrabMode = SDL_GRAB_ON;
break; break;
case SDL_GRAB_FULLSCREEN: case SDL_GRAB_FULLSCREEN:
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment