v0.18.15.0

This commit is contained in:
Regalis11
2022-07-14 16:54:36 +03:00
parent 497045de7e
commit 4a03ee5ab2
36 changed files with 240 additions and 151 deletions

View File

@@ -15,16 +15,16 @@ namespace Microsoft.Xna.Framework.Input
{
return PrimaryWindow.Handle;
}
private static void PlatformSetWindowHandle(IntPtr windowHandle)
{
}
private static MouseState PlatformGetState(GameWindow window)
{
int x, y;
var winFlags = Sdl.Window.GetWindowFlags(window.Handle);
var state = Sdl.Mouse.GetGlobalState(out x, out y);
var state = Sdl.Mouse.GetState(out int x, out int y);
var globalState = Sdl.Mouse.GetGlobalState(out int globalX, out int globalY);
if ((winFlags & Sdl.Window.State.MouseFocus) != 0)
{
@@ -42,8 +42,8 @@ namespace Microsoft.Xna.Framework.Input
{
// Window does not have mouse focus, we need to manually get the position
var clientBounds = window.ClientBounds;
window.MouseState.X = x - clientBounds.X;
window.MouseState.Y = y - clientBounds.Y;
window.MouseState.X = globalX - clientBounds.X;
window.MouseState.Y = globalY - clientBounds.Y;
}
return window.MouseState;
@@ -53,7 +53,6 @@ namespace Microsoft.Xna.Framework.Input
{
PrimaryWindow.MouseState.X = x;
PrimaryWindow.MouseState.Y = y;
Sdl.Mouse.WarpInWindow(PrimaryWindow.Handle, x, y);
}