From 1a03ea2ad2382692ca2999ebbec311cbb5a34285 Mon Sep 17 00:00:00 2001 From: Glatzemann Date: Thu, 15 Dec 2011 09:19:40 +0000 Subject: [PATCH] - Removed InputSystemCreators from ANX.InputDevices.OpenTK and ANX.InputDevices.Windows.Kinect as they don't host InputSystems anymore. - Improved handling of GameWindow handle (needed for mouse and keyboard support) - Improved exception handling while creating mouse and keyboard instances from InputDevice AddIns. - Fixed some sample issues (and opened issues at codeplex for some remaining issues) --- ANX.Framework/ANX.Framework.csproj | 1 + ANX.Framework/NonXNA/InputDeviceFactory.cs | 33 ++++++- .../NonXNA/NoInputDeviceException.cs | 78 ++++++++++++++++ .../ANX.InputDevices.OpenTK.csproj | 4 +- .../{Creator.cs => GamePadCreator.cs} | 65 +++----------- .../KeyboardCreator.cs | 88 +++++++++++++++++++ .../ANX.InputDevices.OpenTK/MouseCreator.cs | 88 +++++++++++++++++++ .../Properties/AssemblyInfo.cs | 4 +- .../ANX.InputDevices.Windows.Kinect.csproj | 10 ++- ...eator.cs => MotionSensingDeviceCreator.cs} | 56 ++++-------- .../Properties/AssemblyInfo.cs | 4 +- .../ANX.InputSystem.Standard/Creator.cs | 33 +++++-- .../Properties/AssemblyInfo.cs | 4 +- .../WindowsGameHost.cs | 4 +- .../Properties/AssemblyInfo.cs | 4 +- .../WindowsGameHost.cs | 4 +- .../Properties/AssemblyInfo.cs | 4 +- .../WindowsGameHost.cs | 4 +- Samples/KeyboardSample/Game1.cs | 1 - Samples/KeyboardSample/KeyboardSample.csproj | 8 ++ Samples/Kinect/Kinect.csproj | 8 ++ Samples/Kinect/Program.cs | 2 - Samples/RenderTarget/RenderTarget.csproj | 8 ++ Samples/SimpleSprite/SimpleSprite.csproj | 8 ++ Samples/StencilBuffer/StencilBuffer.csproj | 8 ++ Samples/TextRendering/TextRendering.csproj | 8 ++ .../VertexIndexBuffer.csproj | 8 ++ Samples/WindowsGame/WindowsGame.csproj | 12 +++ 28 files changed, 436 insertions(+), 123 deletions(-) create mode 100644 ANX.Framework/NonXNA/NoInputDeviceException.cs rename InputSystems/ANX.InputDevices.OpenTK/{Creator.cs => GamePadCreator.cs} (65%) create mode 100644 InputSystems/ANX.InputDevices.OpenTK/KeyboardCreator.cs create mode 100644 InputSystems/ANX.InputDevices.OpenTK/MouseCreator.cs rename InputSystems/ANX.InputDevices.Windows.Kinect/{Creator.cs => MotionSensingDeviceCreator.cs} (74%) diff --git a/ANX.Framework/ANX.Framework.csproj b/ANX.Framework/ANX.Framework.csproj index ebd35114..fc7919b4 100644 --- a/ANX.Framework/ANX.Framework.csproj +++ b/ANX.Framework/ANX.Framework.csproj @@ -430,6 +430,7 @@ + diff --git a/ANX.Framework/NonXNA/InputDeviceFactory.cs b/ANX.Framework/NonXNA/InputDeviceFactory.cs index a056e572..110a4467 100644 --- a/ANX.Framework/NonXNA/InputDeviceFactory.cs +++ b/ANX.Framework/NonXNA/InputDeviceFactory.cs @@ -73,6 +73,8 @@ namespace ANX.Framework.NonXNA private Dictionary motionSensingDeviceCreators; #endif + private IntPtr windowHandle; + private static Logger logger = LogManager.GetCurrentClassLogger(); #endregion // Private Members @@ -178,9 +180,17 @@ namespace ANX.Framework.NonXNA { //TODO: this is a very basic implementation only which needs some more work + if (this.WindowHandle == null || + this.WindowHandle == IntPtr.Zero) + { + throw new Exception("Unable to create a mouse instance because the WindowHandle was not set."); + } + if (this.mouseCreators.Count > 0) { - return this.mouseCreators.Values.First().CreateMouseInstance(); + IMouse mouse = this.mouseCreators.Values.First().CreateMouseInstance(); + mouse.WindowHandle = this.windowHandle; + return mouse; } throw new Exception("Unable to create instance of Mouse because no MouseCreator was registered."); @@ -190,9 +200,17 @@ namespace ANX.Framework.NonXNA { //TODO: this is a very basic implementation only which needs some more work + if (this.WindowHandle == null || + this.WindowHandle == IntPtr.Zero) + { + throw new Exception("Unable to create a keyboard instance because the WindowHandle was not set."); + } + if (this.keyboardCreators.Count > 0) { - return this.keyboardCreators.Values.First().CreateKeyboardInstance(); + IKeyboard keyboard = this.keyboardCreators.Values.First().CreateKeyboardInstance(); + keyboard.WindowHandle = this.windowHandle; + return keyboard; } throw new Exception("Unable to create instance of Keyboard because no KeyboardCreator was registered."); @@ -212,5 +230,16 @@ namespace ANX.Framework.NonXNA } #endif + public IntPtr WindowHandle + { + get + { + return this.windowHandle; + } + internal set + { + this.windowHandle = value; + } + } } } diff --git a/ANX.Framework/NonXNA/NoInputDeviceException.cs b/ANX.Framework/NonXNA/NoInputDeviceException.cs new file mode 100644 index 00000000..a054fb25 --- /dev/null +++ b/ANX.Framework/NonXNA/NoInputDeviceException.cs @@ -0,0 +1,78 @@ +#region Using Statements +using System; +using System.Runtime.Serialization; +#endregion + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.Framework.NonXNA +{ + public class NoInputDeviceException : Exception + { + public NoInputDeviceException() + : base() + { + } + + protected NoInputDeviceException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + + public NoInputDeviceException(string message) + : base(message) + { + } + + public NoInputDeviceException(string message, Exception innerException) + : base(message, innerException) + { + } + + } +} diff --git a/InputSystems/ANX.InputDevices.OpenTK/ANX.InputDevices.OpenTK.csproj b/InputSystems/ANX.InputDevices.OpenTK/ANX.InputDevices.OpenTK.csproj index 8a59fad5..38c1352e 100644 --- a/InputSystems/ANX.InputDevices.OpenTK/ANX.InputDevices.OpenTK.csproj +++ b/InputSystems/ANX.InputDevices.OpenTK/ANX.InputDevices.OpenTK.csproj @@ -48,15 +48,17 @@ - + + Metadata.resx True True + diff --git a/InputSystems/ANX.InputDevices.OpenTK/Creator.cs b/InputSystems/ANX.InputDevices.OpenTK/GamePadCreator.cs similarity index 65% rename from InputSystems/ANX.InputDevices.OpenTK/Creator.cs rename to InputSystems/ANX.InputDevices.OpenTK/GamePadCreator.cs index 0df68d97..76580e9e 100644 --- a/InputSystems/ANX.InputDevices.OpenTK/Creator.cs +++ b/InputSystems/ANX.InputDevices.OpenTK/GamePadCreator.cs @@ -7,6 +7,7 @@ using System.IO; using System.Runtime.InteropServices; using ANX.Framework.NonXNA; using NLog; +using ANX.Framework.NonXNA.InputSystem; #endregion // Using Statements @@ -59,75 +60,29 @@ using NLog; namespace ANX.InputDevices.OpenTK { - public class Creator : IInputSystemCreator + public class GamePadCreator : IGamePadCreator { - private static Logger logger = LogManager.GetCurrentClassLogger(); - public string Name { get { - return "OpenTK"; + return "OpenTK.GamePad"; } } + public void RegisterCreator(InputDeviceFactory factory) + { + factory.AddCreator(this); + } + public int Priority { get { return 100; } } - public bool IsSupported + public IGamePad CreateGamePadInstance() { - get - { - //TODO: this is just a very basic version of test for support - return AddInSystemFactory.Instance.OperatingSystem.Platform == PlatformID.Win32NT || - AddInSystemFactory.Instance.OperatingSystem.Platform == PlatformID.Unix || - AddInSystemFactory.Instance.OperatingSystem.Platform == PlatformID.MacOSX; - } + return new GamePad(); } - - public void RegisterCreator(AddInSystemFactory factory) - { - logger.Debug("adding OpenTK InputSystem creator to creator collection of AddInSystemFactory"); - factory.AddCreator(this); - } - - public IGamePad GamePad - { - get - { - logger.Debug("returning a new OpenTK GamePad device"); - AddInSystemFactory.Instance.PreventInputSystemChange(); - return new GamePad(); - } - } - - public IMouse Mouse - { - get - { - logger.Debug("returning a new OpenTK Mouse device"); - AddInSystemFactory.Instance.PreventInputSystemChange(); - return new Mouse(); - } - } - - public IKeyboard Keyboard - { - get - { - logger.Debug("returning a new OpenTK Keyboard device"); - AddInSystemFactory.Instance.PreventInputSystemChange(); - return new Keyboard(); - } - } - -#if XNAEXT - public IMotionSensingDevice MotionSensingDevice - { - get { return null; } - } -#endif } } diff --git a/InputSystems/ANX.InputDevices.OpenTK/KeyboardCreator.cs b/InputSystems/ANX.InputDevices.OpenTK/KeyboardCreator.cs new file mode 100644 index 00000000..7511047c --- /dev/null +++ b/InputSystems/ANX.InputDevices.OpenTK/KeyboardCreator.cs @@ -0,0 +1,88 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; +using ANX.Framework.NonXNA; +using NLog; +using ANX.Framework.NonXNA.InputSystem; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.InputDevices.OpenTK +{ + public class KeyboardCreator : IKeyboardCreator + { + public string Name + { + get + { + return "OpenTK.Keyboard"; + } + } + + public void RegisterCreator(InputDeviceFactory factory) + { + factory.AddCreator(this); + } + + public int Priority + { + get { return 100; } + } + + public IKeyboard CreateKeyboardInstance() + { + return new Keyboard(); + } + } +} diff --git a/InputSystems/ANX.InputDevices.OpenTK/MouseCreator.cs b/InputSystems/ANX.InputDevices.OpenTK/MouseCreator.cs new file mode 100644 index 00000000..3fd07d3f --- /dev/null +++ b/InputSystems/ANX.InputDevices.OpenTK/MouseCreator.cs @@ -0,0 +1,88 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; +using ANX.Framework.NonXNA; +using NLog; +using ANX.Framework.NonXNA.InputSystem; + +#endregion // Using Statements + +#region License + +// +// This file is part of the ANX.Framework created by the "ANX.Framework developer group". +// +// This file is released under the Ms-PL license. +// +// +// +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the software, you accept this license. +// If you do not accept the license, do not use the software. +// +// 1.Definitions +// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning +// here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to the software. +// A "contributor" is any person that distributes its contribution under this license. +// "Licensed patents" are a contributor's patent claims that read directly on its contribution. +// +// 2.Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations +// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to +// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution +// or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in +// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed +// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution +// in the software or derivative works of the contribution in the software. +// +// 3.Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your +// patent license from such contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution +// notices that are present in the software. +// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including +// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or +// object code form, you may only do so under a license that complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, +// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the +// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. + +#endregion // License + +namespace ANX.InputDevices.OpenTK +{ + public class MouseCreator : IMouseCreator + { + public string Name + { + get + { + return "OpenTK.Mouse"; + } + } + + public void RegisterCreator(InputDeviceFactory factory) + { + factory.AddCreator(this); + } + + public int Priority + { + get { return 100; } + } + + public IMouse CreateMouseInstance() + { + return new Mouse(); + } + } +} diff --git a/InputSystems/ANX.InputDevices.OpenTK/Properties/AssemblyInfo.cs b/InputSystems/ANX.InputDevices.OpenTK/Properties/AssemblyInfo.cs index c55c5cc1..e2a2fc9d 100644 --- a/InputSystems/ANX.InputDevices.OpenTK/Properties/AssemblyInfo.cs +++ b/InputSystems/ANX.InputDevices.OpenTK/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.2.0")] -[assembly: AssemblyFileVersion("0.0.2.0")] +[assembly: AssemblyVersion("0.0.3.0")] +[assembly: AssemblyFileVersion("0.0.3.0")] diff --git a/InputSystems/ANX.InputDevices.Windows.Kinect/ANX.InputDevices.Windows.Kinect.csproj b/InputSystems/ANX.InputDevices.Windows.Kinect/ANX.InputDevices.Windows.Kinect.csproj index 9715dcdb..1e19bb72 100644 --- a/InputSystems/ANX.InputDevices.Windows.Kinect/ANX.InputDevices.Windows.Kinect.csproj +++ b/InputSystems/ANX.InputDevices.Windows.Kinect/ANX.InputDevices.Windows.Kinect.csproj @@ -41,6 +41,14 @@ False ..\..\lib\KinectSDK\Microsoft.Research.Kinect.dll + + False + ..\..\lib\NLog\NLog.dll + + + False + ..\..\lib\NLog\NLog.Extended.dll + @@ -53,13 +61,13 @@ - Metadata.resx True True + PublicResXFileCodeGenerator diff --git a/InputSystems/ANX.InputDevices.Windows.Kinect/Creator.cs b/InputSystems/ANX.InputDevices.Windows.Kinect/MotionSensingDeviceCreator.cs similarity index 74% rename from InputSystems/ANX.InputDevices.Windows.Kinect/Creator.cs rename to InputSystems/ANX.InputDevices.Windows.Kinect/MotionSensingDeviceCreator.cs index dd8844d8..3edf33cc 100644 --- a/InputSystems/ANX.InputDevices.Windows.Kinect/Creator.cs +++ b/InputSystems/ANX.InputDevices.Windows.Kinect/MotionSensingDeviceCreator.cs @@ -1,7 +1,13 @@ #region Using Statements using System; -using ANX.Framework.Input; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; using ANX.Framework.NonXNA; +using NLog; +using ANX.Framework.NonXNA.InputSystem; #endregion // Using Statements @@ -52,62 +58,34 @@ using ANX.Framework.NonXNA; #endregion // License - namespace ANX.InputDevices.Windows.Kinect { - public class Creator : IInputSystemCreator + public class MotionSensingDeviceCreator : IMotionSensingDeviceCreator { public string Name { - get { return "Kinect"; } - } - - public int Priority - { - get { return int.MaxValue; } - } - - public bool IsSupported - { - get - { - //TODO: this is just a very basic version of test for support - return AddInSystemFactory.Instance.OperatingSystem.Platform == PlatformID.Win32NT; + get + { + return "Kinect"; } } - public void RegisterCreator(AddInSystemFactory factory) + public void RegisterCreator(InputDeviceFactory factory) { factory.AddCreator(this); } - #region IInputSystemCreator Member - - public IGamePad GamePad - { - get { throw new NotImplementedException(); } - } - - public IMouse Mouse - { - get { return null; } - } - - public IMotionSensingDevice MotionSensingDevice + public int Priority { get - { - AddInSystemFactory.Instance.PreventInputSystemChange(); - return new Kinect(); + { + return 10000; } } - public IKeyboard Keyboard + public IMotionSensingDevice CreateMotionSensingDeviceInstance() { - get { throw new NotImplementedException(); } + return new Kinect(); } - - #endregion - } } diff --git a/InputSystems/ANX.InputDevices.Windows.Kinect/Properties/AssemblyInfo.cs b/InputSystems/ANX.InputDevices.Windows.Kinect/Properties/AssemblyInfo.cs index 29d38834..c5052a95 100644 --- a/InputSystems/ANX.InputDevices.Windows.Kinect/Properties/AssemblyInfo.cs +++ b/InputSystems/ANX.InputDevices.Windows.Kinect/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.5.4.0")] -[assembly: AssemblyFileVersion("0.5.4.0")] +[assembly: AssemblyVersion("0.5.5.0")] +[assembly: AssemblyFileVersion("0.5.5.0")] diff --git a/InputSystems/ANX.InputSystem.Standard/Creator.cs b/InputSystems/ANX.InputSystem.Standard/Creator.cs index 81ffa479..0805d51c 100644 --- a/InputSystems/ANX.InputSystem.Standard/Creator.cs +++ b/InputSystems/ANX.InputSystem.Standard/Creator.cs @@ -63,6 +63,9 @@ namespace ANX.InputDevices.Windows.XInput { private static Logger logger = LogManager.GetCurrentClassLogger(); + private IKeyboard keyboard; + private IMouse mouse; + public string Name { get @@ -104,9 +107,18 @@ namespace ANX.InputDevices.Windows.XInput { get { - logger.Debug("returning a new Mouse device"); - AddInSystemFactory.Instance.PreventInputSystemChange(); - return InputDeviceFactory.Instance.GetDefaultMouse(); + if (this.mouse == null) + { + this.mouse = InputDeviceFactory.Instance.GetDefaultMouse(); + if (this.mouse == null) + { + throw new NoInputDeviceException("couldn't find a default mouse device creator. Unable to create a mouse instance."); + } + logger.Debug("created a new Mouse device"); + AddInSystemFactory.Instance.PreventInputSystemChange(); + } + + return this.mouse; } } @@ -114,9 +126,18 @@ namespace ANX.InputDevices.Windows.XInput { get { - logger.Debug("returning a new Keyboard device"); - AddInSystemFactory.Instance.PreventInputSystemChange(); - return InputDeviceFactory.Instance.GetDefaultKeyboard(); + if (this.keyboard == null) + { + this.keyboard = InputDeviceFactory.Instance.GetDefaultKeyboard(); + if (this.keyboard == null) + { + throw new NoInputDeviceException("couldn't find a default keyboard device creator. Unable to create a keyboard instance."); + } + logger.Debug("created a new Keyboard device"); + AddInSystemFactory.Instance.PreventInputSystemChange(); + } + + return this.keyboard; } } diff --git a/RenderSystems/ANX.Framework.Windows.DX10/Properties/AssemblyInfo.cs b/RenderSystems/ANX.Framework.Windows.DX10/Properties/AssemblyInfo.cs index 4224b410..fd8bfe69 100644 --- a/RenderSystems/ANX.Framework.Windows.DX10/Properties/AssemblyInfo.cs +++ b/RenderSystems/ANX.Framework.Windows.DX10/Properties/AssemblyInfo.cs @@ -32,7 +32,7 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.7.11.0")] -[assembly: AssemblyFileVersion("0.7.11.0")] +[assembly: AssemblyVersion("0.7.12.0")] +[assembly: AssemblyFileVersion("0.7.12.0")] [assembly: InternalsVisibleTo("ANX.Framework.ContentPipeline")] diff --git a/RenderSystems/ANX.Framework.Windows.DX10/WindowsGameHost.cs b/RenderSystems/ANX.Framework.Windows.DX10/WindowsGameHost.cs index f0712769..4b32499a 100644 --- a/RenderSystems/ANX.Framework.Windows.DX10/WindowsGameHost.cs +++ b/RenderSystems/ANX.Framework.Windows.DX10/WindowsGameHost.cs @@ -6,6 +6,7 @@ using System.Text; using System.Windows.Forms; using ANX.Framework.Windows.DX10; using ANX.Framework.Input; +using ANX.Framework.NonXNA; #endregion // Using Statements @@ -70,8 +71,7 @@ namespace ANX.Framework this.game = game; //this.LockThreadToProcessor(); this.gameWindow = new WindowsGameWindow(); - Mouse.WindowHandle = this.gameWindow.Handle; //TODO: find a way to initialize all InputSystems with one Handle - Keyboard.WindowHandle = this.gameWindow.Handle; + InputDeviceFactory.Instance.WindowHandle = this.gameWindow.Handle; //TouchPanel.WindowHandle = this.gameWindow.Handle; //this.gameWindow.IsMouseVisible = game.IsMouseVisible; this.gameWindow.Activated += new EventHandler(this.GameWindowActivated); diff --git a/RenderSystems/ANX.Framework.Windows.GL3/Properties/AssemblyInfo.cs b/RenderSystems/ANX.Framework.Windows.GL3/Properties/AssemblyInfo.cs index a6bf402f..bdc52529 100644 --- a/RenderSystems/ANX.Framework.Windows.GL3/Properties/AssemblyInfo.cs +++ b/RenderSystems/ANX.Framework.Windows.GL3/Properties/AssemblyInfo.cs @@ -32,7 +32,7 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.5.9.0")] -[assembly: AssemblyFileVersion("0.5.9.0")] +[assembly: AssemblyVersion("0.5.10.0")] +[assembly: AssemblyFileVersion("0.5.10.0")] [assembly: InternalsVisibleTo("ANX.Framework.ContentPipeline")] diff --git a/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameHost.cs b/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameHost.cs index 0b647545..9eafa017 100644 --- a/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameHost.cs +++ b/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameHost.cs @@ -2,6 +2,7 @@ using System.Windows.Forms; using NLog; using ANX.Framework.Input; +using ANX.Framework.NonXNA; #region License @@ -83,8 +84,7 @@ 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; + InputDeviceFactory.Instance.WindowHandle = this.gameWindow.Handle; logger.Info("hook up GameWindow events"); gameWindow.Activated += delegate diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX11/Properties/AssemblyInfo.cs b/RenderSystems/ANX.RenderSystem.Windows.DX11/Properties/AssemblyInfo.cs index fad5e17d..f0da97a5 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.DX11/Properties/AssemblyInfo.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.DX11/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Buildnummer // Revision // -[assembly: AssemblyVersion("0.7.3.0")] -[assembly: AssemblyFileVersion("0.7.3.0")] +[assembly: AssemblyVersion("0.7.4.0")] +[assembly: AssemblyFileVersion("0.7.4.0")] diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX11/WindowsGameHost.cs b/RenderSystems/ANX.RenderSystem.Windows.DX11/WindowsGameHost.cs index feb5fc42..3deb168a 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.DX11/WindowsGameHost.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.DX11/WindowsGameHost.cs @@ -7,6 +7,7 @@ using System.Windows.Forms; using ANX.Framework.Windows.DX10; using ANX.Framework.Input; using ANX.Framework; +using ANX.Framework.NonXNA; #endregion // Using Statements @@ -71,8 +72,7 @@ namespace ANX.RenderSystem.Windows.DX11 this.game = game; //this.LockThreadToProcessor(); this.gameWindow = new WindowsGameWindow(); - Mouse.WindowHandle = this.gameWindow.Handle; //TODO: find a way to initialize all InputSystems with one Handle - Keyboard.WindowHandle = this.gameWindow.Handle; + InputDeviceFactory.Instance.WindowHandle = this.gameWindow.Handle; //TouchPanel.WindowHandle = this.gameWindow.Handle; //this.gameWindow.IsMouseVisible = game.IsMouseVisible; this.gameWindow.Activated += new EventHandler(this.GameWindowActivated); diff --git a/Samples/KeyboardSample/Game1.cs b/Samples/KeyboardSample/Game1.cs index dab6172e..063f611d 100644 --- a/Samples/KeyboardSample/Game1.cs +++ b/Samples/KeyboardSample/Game1.cs @@ -33,7 +33,6 @@ namespace KeyboardSample protected override void Initialize() { - //TODO: see CodePlex issue #454 this.lastKeyState = Keyboard.GetState(); base.Initialize(); diff --git a/Samples/KeyboardSample/KeyboardSample.csproj b/Samples/KeyboardSample/KeyboardSample.csproj index c2f54a99..c4dd0d70 100644 --- a/Samples/KeyboardSample/KeyboardSample.csproj +++ b/Samples/KeyboardSample/KeyboardSample.csproj @@ -83,6 +83,14 @@ {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35} ANX.Framework + + {60D08399-244F-46A3-91F1-4CFD26D961A3} + ANX.InputDevices.Windows.XInput + + + {49066074-3B7B-4A55-B122-6BD33AB73558} + ANX.InputSystem.Standard + {5BE49183-2F6F-4527-AC90-D816911FCF90} ANX.Framework.Windows.DX10 diff --git a/Samples/Kinect/Kinect.csproj b/Samples/Kinect/Kinect.csproj index 8de77fab..9c2c929e 100644 --- a/Samples/Kinect/Kinect.csproj +++ b/Samples/Kinect/Kinect.csproj @@ -110,6 +110,14 @@ {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35} ANX.Framework + + {E5D69E75-D77C-493F-BBDA-6F9E73B82549} + ANX.InputDevices.Windows.Kinect + + + {49066074-3B7B-4A55-B122-6BD33AB73558} + ANX.InputSystem.Standard + {5BE49183-2F6F-4527-AC90-D816911FCF90} ANX.Framework.Windows.DX10 diff --git a/Samples/Kinect/Program.cs b/Samples/Kinect/Program.cs index 4ac27ec5..fa89ec18 100644 --- a/Samples/Kinect/Program.cs +++ b/Samples/Kinect/Program.cs @@ -11,8 +11,6 @@ namespace Kinect /// static void Main(string[] args) { - AddInSystemFactory.Instance.PreferredInputSystem = "Kinect"; - using (Game1 game = new Game1()) { game.Run(); diff --git a/Samples/RenderTarget/RenderTarget.csproj b/Samples/RenderTarget/RenderTarget.csproj index 73f6bc1f..294d40c9 100644 --- a/Samples/RenderTarget/RenderTarget.csproj +++ b/Samples/RenderTarget/RenderTarget.csproj @@ -83,6 +83,14 @@ {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35} ANX.Framework + + {60D08399-244F-46A3-91F1-4CFD26D961A3} + ANX.InputDevices.Windows.XInput + + + {49066074-3B7B-4A55-B122-6BD33AB73558} + ANX.InputSystem.Standard + {5BE49183-2F6F-4527-AC90-D816911FCF90} ANX.Framework.Windows.DX10 diff --git a/Samples/SimpleSprite/SimpleSprite.csproj b/Samples/SimpleSprite/SimpleSprite.csproj index 1672938b..3b0b65c4 100644 --- a/Samples/SimpleSprite/SimpleSprite.csproj +++ b/Samples/SimpleSprite/SimpleSprite.csproj @@ -83,6 +83,14 @@ {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35} ANX.Framework + + {60D08399-244F-46A3-91F1-4CFD26D961A3} + ANX.InputDevices.Windows.XInput + + + {49066074-3B7B-4A55-B122-6BD33AB73558} + ANX.InputSystem.Standard + {5BE49183-2F6F-4527-AC90-D816911FCF90} ANX.Framework.Windows.DX10 diff --git a/Samples/StencilBuffer/StencilBuffer.csproj b/Samples/StencilBuffer/StencilBuffer.csproj index d7d99658..667735c5 100644 --- a/Samples/StencilBuffer/StencilBuffer.csproj +++ b/Samples/StencilBuffer/StencilBuffer.csproj @@ -120,6 +120,14 @@ {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35} ANX.Framework + + {60D08399-244F-46A3-91F1-4CFD26D961A3} + ANX.InputDevices.Windows.XInput + + + {49066074-3B7B-4A55-B122-6BD33AB73558} + ANX.InputSystem.Standard + {5BE49183-2F6F-4527-AC90-D816911FCF90} ANX.Framework.Windows.DX10 diff --git a/Samples/TextRendering/TextRendering.csproj b/Samples/TextRendering/TextRendering.csproj index ce5325d8..7af88168 100644 --- a/Samples/TextRendering/TextRendering.csproj +++ b/Samples/TextRendering/TextRendering.csproj @@ -83,6 +83,14 @@ {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35} ANX.Framework + + {60D08399-244F-46A3-91F1-4CFD26D961A3} + ANX.InputDevices.Windows.XInput + + + {49066074-3B7B-4A55-B122-6BD33AB73558} + ANX.InputSystem.Standard + {5BE49183-2F6F-4527-AC90-D816911FCF90} ANX.Framework.Windows.DX10 diff --git a/Samples/VertexIndexBuffer/VertexIndexBuffer.csproj b/Samples/VertexIndexBuffer/VertexIndexBuffer.csproj index c44a9ab1..59078490 100644 --- a/Samples/VertexIndexBuffer/VertexIndexBuffer.csproj +++ b/Samples/VertexIndexBuffer/VertexIndexBuffer.csproj @@ -83,6 +83,14 @@ {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35} ANX.Framework + + {60D08399-244F-46A3-91F1-4CFD26D961A3} + ANX.InputDevices.Windows.XInput + + + {49066074-3B7B-4A55-B122-6BD33AB73558} + ANX.InputSystem.Standard + {5BE49183-2F6F-4527-AC90-D816911FCF90} ANX.Framework.Windows.DX10 diff --git a/Samples/WindowsGame/WindowsGame.csproj b/Samples/WindowsGame/WindowsGame.csproj index 5bce082d..17e3d376 100644 --- a/Samples/WindowsGame/WindowsGame.csproj +++ b/Samples/WindowsGame/WindowsGame.csproj @@ -99,6 +99,18 @@ {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35} ANX.Framework + + {5CA3CDF5-4D2C-42AC-AD08-641BD3992B75} + ANX.InputDevices.OpenTK + + + {E5D69E75-D77C-493F-BBDA-6F9E73B82549} + ANX.InputDevices.Windows.Kinect + + + {60D08399-244F-46A3-91F1-4CFD26D961A3} + ANX.InputDevices.Windows.XInput + {DB88DDEB-7281-405D-8FCA-5681B6B2BD7A} ANX.InputSystem.Recording