Skip to content

Commit

Permalink
Initialised Mouse Position on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
HughPH committed Sep 30, 2020
1 parent d0a2210 commit 9b77d0b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/OpenTK.Windowing.Desktop/NativeWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,9 @@ public unsafe NativeWindow(NativeWindowSettings settings)
GLFW.GetWindowPos(WindowPtr, out var x, out var y);
_location = new Vector2i(x, y);

GLFW.GetCursorPos(WindowPtr, out var mousex, out var mousey);
_lastReportedMousePos = new Vector2((float)mousex, (float)mousey);

_isFocused = GLFW.GetWindowAttrib(WindowPtr, WindowAttributeGetBool.Focused);
}

Expand Down

0 comments on commit 9b77d0b

Please sign in to comment.