Fix cursor incorreclty moved out of window
This commit is contained in:
parent
a3df3b38e5
commit
2fca9b2b13
2 changed files with 5 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue