Slight changes to InputDriver constructor.

This commit is contained in:
the_fiddler 2007-09-21 20:05:56 +00:00
parent 98bf228a3d
commit af35f805ba

View file

@ -21,15 +21,18 @@ namespace OpenTK
public InputDriver(IWindowInfo parent) public InputDriver(IWindowInfo parent)
{ {
if (parent == null)
throw new ArgumentException("A valid window (IWindowInfo) must be specified to construct an InputDriver");
if (Environment.OSVersion.Version.Major > 5 || if (Environment.OSVersion.Version.Major > 5 ||
(Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1)) (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1))
{ {
inputDriver = new OpenTK.Platform.Windows.WinRawInput(parent as OpenTK.Platform.Windows.WindowInfo); inputDriver = new OpenTK.Platform.Windows.WinRawInput(parent);
} }
else if (Environment.OSVersion.Platform == PlatformID.Unix) else if (Environment.OSVersion.Platform == PlatformID.Unix)
{ {
inputDriver = inputDriver =
new OpenTK.Platform.X11.X11Input(parent as OpenTK.Platform.X11.WindowInfo); new OpenTK.Platform.X11.X11Input(parent);
} }
else else
{ {
@ -52,7 +55,7 @@ namespace OpenTK
get { return inputDriver.Keyboard; } get { return inputDriver.Keyboard; }
} }
public IList<OpenTK.Input.Mouse> Mouse public IList<Mouse> Mouse
{ {
get { return inputDriver.Mouse; } get { return inputDriver.Mouse; }
} }
@ -61,7 +64,12 @@ namespace OpenTK
{ {
inputDriver.ProcessEvents(); inputDriver.ProcessEvents();
} }
/*
int IMouseDriver.RegisterDevices()
{
return inputDriver.RegisterDevices();
}
*/
#endregion #endregion
#region --- IDisposable Members --- #region --- IDisposable Members ---