23 #if SDL_VIDEO_DRIVER_COCOA
27 #include "../SDL_sysvideo.h"
28 #include "../../events/SDL_keyboard_c.h"
29 #include "../../events/SDL_mouse_c.h"
30 #include "../../events/SDL_touch_c.h"
31 #include "../../events/SDL_windowevents_c.h"
37 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
39 @interface NSView (NSOpenGLSurfaceResolution)
40 - (
BOOL)wantsBestResolutionOpenGLSurface;
41 - (
void)setWantsBestResolutionOpenGLSurface:(
BOOL)flag;
49 r->origin.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - r->origin.
y - r->
size.
height;
55 @
synchronized (contexts) {
56 for (SDLOpenGLContext *
context in contexts) {
57 [context scheduleUpdate];
66 NSNotificationCenter *center;
68 NSView *view = [window contentView];
75 center = [NSNotificationCenter defaultCenter];
77 if ([window delegate] != nil) {
78 [center addObserver:self selector:@selector(windowDidExpose:) name:NSWindowDidExposeNotification object:window];
79 [center addObserver:self selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:window];
80 [center addObserver:self selector:@selector(windowDidResize:) name:NSWindowDidResizeNotification object:window];
81 [center addObserver:self selector:@selector(windowDidMiniaturize:) name:NSWindowDidMiniaturizeNotification object:window];
82 [center addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:window];
83 [center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:window];
84 [center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window];
86 [window setDelegate:self];
93 [window addObserver:self
95 options:NSKeyValueObservingOptionNew
98 [window setNextResponder:self];
99 [window setAcceptsMouseMovedEvents:YES];
101 [view setNextResponder:self];
103 if ([view respondsToSelector:
@selector(setAcceptsTouchEvents:)]) {
104 [view setAcceptsTouchEvents:YES];
108 - (
void)observeValueForKeyPath:(NSString *)keyPath
110 change:(NSDictionary *)change
111 context:(
void *)context
117 if (
object ==
_data->
nswindow && [keyPath isEqualToString:
@"visible"]) {
118 int newVisibility = [[change objectForKey:@"new"] intValue];
135 BOOL isVisible = [_data->nswindow isVisible];
150 NSNotificationCenter *center;
152 NSView *view = [window contentView];
153 NSArray *windows = nil;
155 center = [NSNotificationCenter defaultCenter];
157 if ([window delegate] !=
self) {
158 [center removeObserver:self name:NSWindowDidExposeNotification object:window];
159 [center removeObserver:self name:NSWindowDidMoveNotification object:window];
160 [center removeObserver:self name:NSWindowDidResizeNotification object:window];
161 [center removeObserver:self name:NSWindowDidMiniaturizeNotification object:window];
162 [center removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window];
163 [center removeObserver:self name:NSWindowDidBecomeKeyNotification object:window];
164 [center removeObserver:self name:NSWindowDidResignKeyNotification object:window];
166 [window setDelegate:nil];
169 [window removeObserver:self
170 forKeyPath:@"visible"];
172 if ([window nextResponder] ==
self) {
173 [window setNextResponder:nil];
175 if ([view nextResponder] ==
self) {
176 [view setNextResponder:nil];
188 windows = [NSApp orderedWindows];
189 if ([windows
count] > 0) {
190 NSWindow *win = (NSWindow *) [windows objectAtIndex:0];
191 [win makeKeyAndOrderFront:self];
195 - (
BOOL)windowShouldClose:(
id)sender
201 - (
void)windowDidExpose:(NSNotification *)aNotification
206 - (
void)windowDidMove:(NSNotification *)aNotification
211 NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]];
212 ConvertNSRect(&rect);
221 rect.origin.x = window->
x;
222 rect.origin.y = window->
y;
223 ConvertNSRect(&rect);
224 [nswindow setFrameOrigin:rect.origin];
229 x = (
int)rect.origin.x;
230 y = (
int)rect.origin.y;
232 ScheduleContextUpdates(
_data);
237 - (
void)windowDidResize:(NSNotification *)aNotification
240 NSRect rect = [_data->nswindow contentRectForFrameRect:[_data->nswindow frame]];
241 ConvertNSRect(&rect);
242 x = (
int)rect.origin.x;
243 y = (
int)rect.origin.y;
244 w = (
int)rect.size.width;
245 h = (
int)rect.size.height;
249 ScheduleContextUpdates(
_data);
256 const BOOL zoomed = [_data->nswindow isZoomed];
264 - (
void)windowDidMiniaturize:(NSNotification *)aNotification
269 - (
void)windowDidDeminiaturize:(NSNotification *)aNotification
274 - (
void)windowDidBecomeKey:(NSNotification *)aNotification
287 point = [_data->nswindow mouseLocationOutsideOfEventStream];
289 y = (
int)(window->
h - point.y);
300 - (
void)windowDidResignKey:(NSNotification *)aNotification
317 - (
void)flagsChanged:(NSEvent *)theEvent
321 - (
void)keyDown:(NSEvent *)theEvent
325 - (
void)keyUp:(NSEvent *)theEvent
333 - (
void)doCommandBySelector:(
SEL)aSelector
338 - (
void)mouseDown:(NSEvent *)theEvent
342 switch ([theEvent buttonNumber]) {
344 if ([theEvent modifierFlags] & NSControlKeyMask) {
359 button = [theEvent buttonNumber] + 1;
365 - (
void)rightMouseDown:(NSEvent *)theEvent
367 [
self mouseDown:theEvent];
370 - (
void)otherMouseDown:(NSEvent *)theEvent
372 [
self mouseDown:theEvent];
375 - (
void)mouseUp:(NSEvent *)theEvent
379 switch ([theEvent buttonNumber]) {
395 button = [theEvent buttonNumber] + 1;
401 - (
void)rightMouseUp:(NSEvent *)theEvent
403 [
self mouseUp:theEvent];
406 - (
void)otherMouseUp:(NSEvent *)theEvent
408 [
self mouseUp:theEvent];
411 - (
void)mouseMoved:(NSEvent *)theEvent
422 point = [theEvent locationInWindow];
424 y = (
int)(window->
h - point.y);
432 }
else if (x >= window->
w) {
437 }
else if (y >= window->
h) {
441 #if !SDL_MAC_NO_SANDBOX
446 cgpoint.x = window->
x + x;
447 cgpoint.y = window->
y + y;
453 CGSetLocalEventsSuppressionInterval(0.0);
454 CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
455 CGSetLocalEventsSuppressionInterval(0.25);
462 - (
void)mouseDragged:(NSEvent *)theEvent
464 [
self mouseMoved:theEvent];
467 - (
void)rightMouseDragged:(NSEvent *)theEvent
469 [
self mouseMoved:theEvent];
472 - (
void)otherMouseDragged:(NSEvent *)theEvent
474 [
self mouseMoved:theEvent];
477 - (
void)scrollWheel:(NSEvent *)theEvent
482 - (
void)touchesBeganWithEvent:(NSEvent *) theEvent
484 [
self handleTouches:COCOA_TOUCH_DOWN withEvent:theEvent];
487 - (
void)touchesMovedWithEvent:(NSEvent *) theEvent
489 [
self handleTouches:COCOA_TOUCH_MOVE withEvent:theEvent];
492 - (
void)touchesEndedWithEvent:(NSEvent *) theEvent
494 [
self handleTouches:COCOA_TOUCH_UP withEvent:theEvent];
497 - (
void)touchesCancelledWithEvent:(NSEvent *) theEvent
499 [
self handleTouches:COCOA_TOUCH_CANCELLED withEvent:theEvent];
505 NSEnumerator *enumerator;
510 touches = [event touchesMatchingPhase:NSTouchPhaseBegan inView:nil];
514 touches = [event touchesMatchingPhase:NSTouchPhaseEnded inView:nil];
517 touches = [event touchesMatchingPhase:NSTouchPhaseMoved inView:nil];
521 enumerator = [touches objectEnumerator];
522 touch = (NSTouch*)[enumerator nextObject];
532 float x = [touch normalizedPosition].x;
533 float y = [touch normalizedPosition].y;
550 touch = (NSTouch*)[enumerator nextObject];
556 @interface SDLWindow : NSWindow
558 - (
BOOL)canBecomeKeyWindow;
559 - (
BOOL)canBecomeMainWindow;
562 @implementation SDLWindow
563 - (
BOOL)canBecomeKeyWindow
568 - (
BOOL)canBecomeMainWindow
574 @interface SDLView : NSView
577 - (
void)rightMouseDown:(NSEvent *)theEvent;
580 @implementation SDLView
581 - (
void)rightMouseDown:(NSEvent *)theEvent
583 [[
self nextResponder] rightMouseDown:theEvent];
586 - (
void)resetCursorRects
588 [
super resetCursorRects];
592 [
self addCursorRect:[
self bounds]
593 cursor:mouse->cur_cursor->driverdata];
595 [
self addCursorRect:[
self bounds]
596 cursor:[NSCursor invisibleCursor]];
607 style = NSBorderlessWindowMask;
610 style = NSBorderlessWindowMask;
612 style = (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask);
615 style |= NSResizableWindowMask;
624 NSAutoreleasePool *pool;
637 data->
nscontexts = [[NSMutableArray alloc] init];
639 pool = [[NSAutoreleasePool alloc] init];
646 NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]];
647 ConvertNSRect(&rect);
648 window->
x = (
int)rect.origin.x;
649 window->
y = (
int)rect.origin.y;
650 window->
w = (
int)rect.size.width;
651 window->
h = (
int)rect.size.height;
655 [data->listener listen:data];
657 if ([nswindow isVisible]) {
664 unsigned int style = [nswindow styleMask];
666 if (style == NSBorderlessWindowMask) {
671 if (style & NSResizableWindowMask) {
685 if ([nswindow isMiniaturized]) {
691 if ([nswindow isKeyWindow]) {
699 [nswindow setOneShot:NO];
710 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
718 rect.origin.x = window->
x;
719 rect.origin.y = window->
y;
720 rect.size.width = window->
w;
721 rect.size.height = window->
h;
722 ConvertNSRect(&rect);
724 style = GetWindowStyle(window);
727 NSArray *screens = [NSScreen screens];
728 NSScreen *screen = nil;
730 int i,
count = [screens count];
731 for (i = 0; i <
count; ++i) {
732 candidate = [screens objectAtIndex:i];
733 NSRect screenRect = [candidate frame];
734 if (rect.origin.x >= screenRect.origin.x &&
735 rect.origin.x < screenRect.origin.x + screenRect.size.width &&
736 rect.origin.y >= screenRect.origin.y &&
737 rect.origin.y < screenRect.origin.y + screenRect.size.height) {
739 rect.origin.x -= screenRect.origin.x;
740 rect.origin.y -= screenRect.origin.y;
743 nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO screen:screen];
744 [nswindow setBackgroundColor:[NSColor blackColor]];
747 rect = [nswindow contentRectForFrameRect:[nswindow frame]];
748 NSView *contentView = [[SDLView alloc] initWithFrame:rect];
751 if ([contentView respondsToSelector:
@selector(setWantsBestResolutionOpenGLSurface:)]) {
752 [contentView setWantsBestResolutionOpenGLSurface:YES];
756 [nswindow setContentView: contentView];
757 [contentView release];
761 if (SetupWindowData(
_this, window, nswindow,
SDL_TRUE) < 0) {
771 NSAutoreleasePool *pool;
772 NSWindow *nswindow = (NSWindow *) data;
775 pool = [[NSAutoreleasePool alloc] init];
778 title = [nswindow title];
791 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
796 string = [[NSString alloc] initWithUTF8String:window->title];
798 string = [[NSString alloc] init];
800 [nswindow setTitle:string];
809 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
813 [NSApp setApplicationIconImage:nsimage];
822 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
824 NSWindow *nswindow = windata->
nswindow;
828 rect.origin.x = window->
x;
829 rect.origin.y = window->
y;
830 rect.size.width = window->
w;
831 rect.size.height = window->
h;
832 ConvertNSRect(&rect);
834 moveHack = s_moveHack;
836 [nswindow setFrameOrigin:rect.origin];
837 s_moveHack = moveHack;
839 ScheduleContextUpdates(windata);
847 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
849 NSWindow *nswindow = windata->
nswindow;
852 size.width = window->
w;
853 size.height = window->
h;
854 [nswindow setContentSize:
size];
856 ScheduleContextUpdates(windata);
864 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
868 minSize.width = window->
min_w;
869 minSize.height = window->
min_h;
871 [windata->
nswindow setContentMinSize:minSize];
879 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
883 maxSize.width = window->
max_w;
884 maxSize.height = window->
max_h;
886 [windata->
nswindow setContentMaxSize:maxSize];
894 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
896 NSWindow *nswindow = windowData->
nswindow;
898 if (![nswindow isMiniaturized]) {
899 [windowData->listener pauseVisibleObservation];
900 [nswindow makeKeyAndOrderFront:nil];
901 [windowData->listener resumeVisibleObservation];
909 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
912 [nswindow orderOut:nil];
919 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
921 NSWindow *nswindow = windowData->
nswindow;
925 [windowData->listener pauseVisibleObservation];
926 if (![nswindow isMiniaturized] && [nswindow isVisible]) {
927 [nswindow makeKeyAndOrderFront:nil];
929 [windowData->listener resumeVisibleObservation];
937 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
939 NSWindow *nswindow = windata->
nswindow;
943 ScheduleContextUpdates(windata);
951 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
954 [nswindow miniaturize:nil];
961 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
964 if ([nswindow isMiniaturized]) {
965 [nswindow deminiaturize:nil];
973 Cocoa_RebuildWindow(
SDL_WindowData * data, NSWindow * nswindow,
unsigned style)
980 [data->listener close];
981 data->
nswindow = [[SDLWindow alloc] initWithContentRect:[[nswindow contentView] frame] styleMask:style backing:NSBackingStoreBuffered defer:NO screen:[nswindow screen]];
982 [data->nswindow setContentView:[nswindow contentView]];
984 [data->nswindow setOneShot:NO];
985 [data->listener listen:data];
995 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
997 if ([nswindow respondsToSelector:
@selector(setStyleMask:)]) {
998 [nswindow setStyleMask:GetWindowStyle(window)];
1009 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
1011 NSWindow *nswindow = data->
nswindow;
1015 if ([[nswindow contentView] nextResponder] == data->
listener) {
1016 [[nswindow contentView] setNextResponder:nil];
1023 rect.origin.x = bounds.
x;
1024 rect.origin.y = bounds.
y;
1025 rect.size.width = bounds.
w;
1026 rect.size.height = bounds.
h;
1027 ConvertNSRect(&rect);
1030 NSRect screenRect = [[nswindow screen] frame];
1031 if (screenRect.size.height >= 1.0f) {
1035 if ([nswindow respondsToSelector:
@selector(setStyleMask:)]) {
1036 [nswindow performSelector: @selector(setStyleMask:) withObject: (id)NSBorderlessWindowMask];
1038 nswindow = Cocoa_RebuildWindow(data, nswindow, NSBorderlessWindowMask);
1045 ConvertNSRect(&rect);
1047 if ([nswindow respondsToSelector:
@selector(setStyleMask:)]) {
1048 [nswindow performSelector: @selector(setStyleMask:) withObject: (id)(uintptr_t)GetWindowStyle(window)];
1050 nswindow = Cocoa_RebuildWindow(data, nswindow, GetWindowStyle(window));
1055 if ([[nswindow contentView] nextResponder] != data->
listener) {
1056 [[nswindow contentView] setNextResponder:data->listener];
1060 [nswindow setFrameOrigin:rect.origin];
1061 [nswindow setContentSize:rect.size];
1071 [nswindow setLevel:CGShieldingWindowLevel()];
1073 [nswindow setLevel:kCGNormalWindowLevel];
1076 if ([nswindow isVisible] || fullscreen) {
1077 [data->listener pauseVisibleObservation];
1078 [nswindow makeKeyAndOrderFront:nil];
1079 [data->listener resumeVisibleObservation];
1082 ScheduleContextUpdates(data);
1093 CGGammaValue redTable[tableSize];
1094 CGGammaValue greenTable[tableSize];
1095 CGGammaValue blueTable[tableSize];
1097 float inv65535 = 1.0f / 65535.0f;
1100 for (i = 0; i < 256; i++) {
1101 redTable[i] = ramp[0*256+i] * inv65535;
1102 greenTable[i] = ramp[1*256+i] * inv65535;
1103 blueTable[i] = ramp[2*256+i] * inv65535;
1106 if (CGSetDisplayTransferByTable(display_id, tableSize,
1107 redTable, greenTable, blueTable) != CGDisplayNoErr) {
1119 CGGammaValue redTable[tableSize];
1120 CGGammaValue greenTable[tableSize];
1121 CGGammaValue blueTable[tableSize];
1124 if (CGGetDisplayTransferByTable(display_id, tableSize,
1125 redTable, greenTable, blueTable, &tableCopied) != CGDisplayNoErr) {
1129 for (i = 0; i < tableCopied; i++) {
1130 ramp[0*256+i] = (
Uint16)(redTable[i] * 65535.0
f);
1131 ramp[1*256+i] = (
Uint16)(greenTable[i] * 65535.0f);
1132 ramp[2*256+i] = (
Uint16)(blueTable[i] * 65535.0f);
1146 cgpoint.x = window->
x + x;
1147 cgpoint.y = window->
y + y;
1148 CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
1156 [data->nswindow setLevel:CGShieldingWindowLevel()];
1158 [data->nswindow setLevel:kCGNormalWindowLevel];
1166 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
1170 [data->listener close];
1171 [data->listener release];
1173 [data->nswindow close];
1176 NSArray *contexts = [[data->nscontexts copy] autorelease];
1177 for (SDLOpenGLContext *context
in contexts) {
1179 [context setWindow:NULL];
1181 [data->nscontexts release];
1195 info->
info.cocoa.window = nswindow;
1198 SDL_SetError(
"Application not compiled with SDL %d.%d\n",
int Cocoa_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
#define SDL_MINOR_VERSION
SDL_Mouse * SDL_GetMouse(void)
NSMutableArray * nscontexts
GLfloat GLfloat GLfloat GLfloat h
void SDL_SetKeyboardFocus(SDL_Window *window)
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size)
void Cocoa_MinimizeWindow(_THIS, SDL_Window *window)
void Cocoa_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon)
#define SDL_MAJOR_VERSION
void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window *window)
void Cocoa_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
DECLSPEC SDL_Window *SDLCALL SDL_GetMouseFocus(void)
Get the window which currently has mouse focus.
A collection of pixels used in software blitting.
DECLSPEC void SDLCALL SDL_free(void *mem)
int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down, float x, float y, float pressure)
EGLSurface EGLint EGLint EGLint EGLint height
void Cocoa_SetWindowTitle(_THIS, SDL_Window *window)
int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2)
void SDL_SetMouseFocus(SDL_Window *window)
void Cocoa_SetWindowPosition(_THIS, SDL_Window *window)
int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, float x, float y, float pressure)
static SDL_VideoDevice * _this
void Cocoa_RestoreWindow(_THIS, SDL_Window *window)
uint32_t Uint32
An unsigned 32-bit integer type.
DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y)
Retrieve the current state of the mouse.
DECLSPEC Uint32 SDLCALL SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
void Cocoa_ShowWindow(_THIS, SDL_Window *window)
DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window)
Return whether the given window is a shaped window.
NSImage * Cocoa_CreateImage(SDL_Surface *surface)
int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Cocoa_WindowListener * listener
struct SDL_VideoData * videodata
DECLSPEC char *SDLCALL SDL_strdup(const char *str)
void resumeVisibleObservation()
int Cocoa_SetWindowGammaRamp(_THIS, SDL_Window *window, const Uint16 *ramp)
void Cocoa_DestroyWindow(_THIS, SDL_Window *window)
void Cocoa_RaiseWindow(_THIS, SDL_Window *window)
SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
void Cocoa_CheckClipboardUpdate(struct SDL_VideoData *data)
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event)
#define SDL_BUTTON_MIDDLE
int SDL_AddTouch(SDL_TouchID touchID, const char *name)
void Cocoa_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
union SDL_SysWMinfo::@78 info
SDL_bool SDL_ShouldAllowTopmost(void)
EGLSurface EGLint EGLint y
#define SDL_OutOfMemory()
int Cocoa_CreateWindow(_THIS, SDL_Window *window)
int Cocoa_GetWindowGammaRamp(_THIS, SDL_Window *window, Uint16 *ramp)
SDL_VideoDisplay * SDL_GetDisplayForWindow(SDL_Window *window)
void Cocoa_SetWindowSize(_THIS, SDL_Window *window)
GLsizei const GLcharARB ** string
int Cocoa_ResizeWindowShape(SDL_Window *window)
GLdouble GLdouble GLdouble r
GLint GLint GLint GLint GLint w
uint16_t Uint16
An unsigned 16-bit integer type.
void pauseVisibleObservation()
void Cocoa_HideWindow(_THIS, SDL_Window *window)
DECLSPEC SDL_Window *SDLCALL SDL_GetKeyboardFocus(void)
Get the window which currently has keyboard focus.
int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
void Cocoa_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
SDL_Touch * SDL_GetTouch(SDL_TouchID id)
int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
void Cocoa_MaximizeWindow(_THIS, SDL_Window *window)
A rectangle, with the origin at the upper left.
void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window *window)
typedef BOOL(WINAPI *PFNWGLSETSTEREOEMITTERSTATE3DLPROC)(HDC hDC