From f4b0c19f448d2ff576ac9433740fdcf648d70af8 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 26 Sep 2007 11:52:40 +0000 Subject: [PATCH] Disabled initialization from Windows.Forms. InputDriver now needs a GameWindow to function. --- Source/OpenTK/InputDriver.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/OpenTK/InputDriver.cs b/Source/OpenTK/InputDriver.cs index da59e032..f4715fa4 100644 --- a/Source/OpenTK/InputDriver.cs +++ b/Source/OpenTK/InputDriver.cs @@ -19,7 +19,7 @@ namespace OpenTK #region --- Constructors --- - public InputDriver(IWindowInfo parent) + public InputDriver(GameWindow parent) { if (parent == null) throw new ArgumentException("A valid window (IWindowInfo) must be specified to construct an InputDriver"); @@ -27,13 +27,14 @@ namespace OpenTK if (Environment.OSVersion.Version.Major > 5 || (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1)) { - inputDriver = new OpenTK.Platform.Windows.WinRawInput(parent); + inputDriver = new OpenTK.Platform.Windows.WinRawInput(parent.WindowInfo); } else if (Environment.OSVersion.Platform == PlatformID.Unix) { - inputDriver = new OpenTK.Platform.X11.X11Input( - parent is OpenTK.Platform.X11.WindowInfo ? (OpenTK.Platform.X11.WindowInfo)parent : - parent is OpenTK.Platform.WindowInfo ? (OpenTK.Platform.X11.WindowInfo)(parent as OpenTK.Platform.WindowInfo) : null); + //inputDriver = new OpenTK.Platform.X11.X11Input( + // parent is OpenTK.Platform.X11.WindowInfo ? (OpenTK.Platform.X11.WindowInfo)parent : + // parent is OpenTK.Platform.WindowInfo ? (OpenTK.Platform.X11.WindowInfo)(parent as OpenTK.Platform.WindowInfo) : null); + inputDriver = new OpenTK.Platform.X11.X11Input(parent.WindowInfo); } else { @@ -46,12 +47,12 @@ namespace OpenTK #region --- IInputDriver Members --- - public IList Keyboard + public IList Keyboard { get { return inputDriver.Keyboard; } } - public IList Mouse + public IList Mouse { get { return inputDriver.Mouse; } }