diff --git a/InputSystems/ANX.InputSystem.Windows.XInput/Mouse.cs b/InputSystems/ANX.InputSystem.Windows.XInput/Mouse.cs index 298e4d63..dc8226fc 100644 --- a/InputSystems/ANX.InputSystem.Windows.XInput/Mouse.cs +++ b/InputSystems/ANX.InputSystem.Windows.XInput/Mouse.cs @@ -64,6 +64,7 @@ namespace ANX.InputSystem.Windows.XInput { class Mouse : IMouse { + #region Interop [DllImport("user32.dll")] static extern bool GetCursorPos(ref Point lpPoint); @@ -73,9 +74,14 @@ namespace ANX.InputSystem.Windows.XInput [DllImport("user32.dll")] static extern bool ScreenToClient(IntPtr hWnd, ref Point lpPoint); + #endregion // Interop + + #region Private Members private DirectInput directInput; private MouseX mouse; - + + #endregion // Private Members + public IntPtr WindowHandle { get; diff --git a/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameHost.cs b/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameHost.cs index 421c72b3..0b647545 100644 --- a/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameHost.cs +++ b/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameHost.cs @@ -1,6 +1,7 @@ using System; using System.Windows.Forms; using NLog; +using ANX.Framework.Input; #region License @@ -82,6 +83,9 @@ namespace ANX.Framework.Windows.GL3 logger.Info("creating a new GameWindow"); gameWindow = new WindowsGameWindow(); + Mouse.WindowHandle = this.gameWindow.Handle; //TODO: find a way to initialize all InputSystems with one Handle + Keyboard.WindowHandle = this.gameWindow.Handle; + logger.Info("hook up GameWindow events"); gameWindow.Activated += delegate {