Fix cursor incorreclty moved out of window

This commit is contained in:
Vlad Kalyuzhny 2017-07-25 00:36:33 +03:00
parent a3df3b38e5
commit 2fca9b2b13
2 changed files with 5 additions and 1 deletions

View file

@ -490,6 +490,10 @@ namespace OpenTK.Platform.SDL2
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WarpMouseInWindow", ExactSpelling = true)]
public static extern void WarpMouseInWindow(IntPtr window, int x, int y);
[SuppressUnmanagedCodeSecurity]
[DllImport (lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_WarpMouseGlobal", ExactSpelling = true)]
public static extern void WarpMouseGlobal(int x, int y);
/// <summary>
/// Retrieves driver-dependent window information.
/// </summary>

View file

@ -146,7 +146,7 @@ namespace OpenTK.Platform.SDL2
public void SetPosition(double x, double y)
{
SDL.WarpMouseInWindow(IntPtr.Zero, (int)x, (int)y);
SDL.WarpMouseGlobal((int)x, (int)y);
}
}
}