From e395a5114d45f7977d5e1ccf8e33590b0686245d Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Sat, 18 Oct 2014 12:39:00 -0400 Subject: [PATCH] 2.0.4 mouse additions --- src/SDL2.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/SDL2.cs b/src/SDL2.cs index 65d34b6..ed5c14a 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -4393,6 +4393,25 @@ namespace SDL2 [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern UInt32 SDL_GetMouseState(IntPtr x, IntPtr y); + /* Get the current state of the mouse, in relation to the desktop */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern UInt32 SDL_GetGlobalMouseState(out int x, out int y); + + /* Get the current state of the mouse, in relation to the desktop */ + /* This overload allows for passing NULL to x */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern UInt32 SDL_GetGlobalMouseState(IntPtr x, out int y); + + /* Get the current state of the mouse, in relation to the desktop */ + /* This overload allows for passing NULL to y */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern UInt32 SDL_GetGlobalMouseState(out int x, IntPtr y); + + /* Get the current state of the mouse, in relation to the desktop */ + /* This overload allows for passing NULL to both x and y */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern UInt32 SDL_GetGlobalMouseState(IntPtr x, IntPtr y); + /* Get the mouse state with relative coords*/ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern UInt32 SDL_GetRelativeMouseState(out int x, out int y); @@ -4402,6 +4421,10 @@ namespace SDL2 [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_WarpMouseInWindow(IntPtr window, int x, int y); + /* Set the mouse cursor's position in global screen space */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void SDL_WarpMouseGlobal(int x, int y); + /* Enable/Disable relative mouse mode (grabs mouse, rel coords) */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetRelativeMouseMode(SDL_bool enabled);