Implement SDL_CaptureMouse() for Mac OS X.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 24 May 2014 18:23:39 -0400
changeset 8928 f60f16d29e37
parent 8927 be64f5daf64b
child 8929 7b459b49fa92
Implement SDL_CaptureMouse() for Mac OS X.
src/video/cocoa/SDL_cocoamouse.m
--- a/src/video/cocoa/SDL_cocoamouse.m	Sat May 24 01:30:37 2014 -0400
+++ b/src/video/cocoa/SDL_cocoamouse.m	Sat May 24 18:23:39 2014 -0400
@@ -274,6 +274,14 @@
     return 0;
 }
 
+static int
+Cocoa_CaptureMouse(SDL_Window *window)
+{
+    /* our Cocoa event code already tracks the mouse outside the window,
+        so all we have to do here is say "okay" and do what we always do. */
+    return 0;
+}
+
 void
 Cocoa_InitMouse(_THIS)
 {
@@ -287,6 +295,7 @@
     mouse->FreeCursor = Cocoa_FreeCursor;
     mouse->WarpMouse = Cocoa_WarpMouse;
     mouse->SetRelativeMouseMode = Cocoa_SetRelativeMouseMode;
+    mouse->CaptureMouse = Cocoa_CaptureMouse;
 
     SDL_SetDefaultCursor(Cocoa_CreateDefaultCursor());