From 818830fc3a6f59e505bb4901e8d741eea891f5aa Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Sat, 18 Oct 2014 12:36:44 -0400 Subject: [PATCH] Overloads for GetMouseState --- src/SDL2.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/SDL2.cs b/src/SDL2.cs index f636285..65d34b6 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -4375,10 +4375,24 @@ namespace SDL2 public static extern IntPtr SDL_GetMouseFocus(); /* Get the current state of the mouse */ - /* NOTE: Not sure if x,y should be 'ref', as SDL accepts null */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern UInt32 SDL_GetMouseState(out int x, out int y); + /* Get the current state of the mouse */ + /* This overload allows for passing NULL to x */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern UInt32 SDL_GetMouseState(IntPtr x, out int y); + + /* Get the current state of the mouse */ + /* This overload allows for passing NULL to y */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern UInt32 SDL_GetMouseState(out int x, IntPtr y); + + /* Get the current state of the mouse */ + /* This overload allows for passing NULL to both x and y */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern UInt32 SDL_GetMouseState(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);