59b503b3c3
WinRawInput now correctly subclasses WinGLNative or WinGLControl. WinRawKeyboard now correctly responds to events. Removed T10_GLSL_Cube.cs which was erroneously moved outside the Examples/Tutorial directory. Updated INativeWindow, IGameWindow and IGLControl interfaces. Updated examples to use the new GameWindow interface. Added documentation to GameWindow. Improved GameWindow error handling. More defensive programming.
40 lines
1 KiB
C#
40 lines
1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
using OpenTK.Input;
|
|
|
|
namespace OpenTK
|
|
{
|
|
public class InputDevices : IInputDriver
|
|
{
|
|
IInputDriver inputDriver;
|
|
|
|
public InputDevices(IntPtr parentHandle)
|
|
{
|
|
if (Environment.OSVersion.Version.Major > 5 ||
|
|
(Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1))
|
|
{
|
|
inputDriver = new OpenTK.Platform.Windows.WinRawInput(parentHandle);
|
|
}
|
|
else
|
|
{
|
|
throw new PlatformNotSupportedException("Input is not implemented for platforms prior to Windows XP, yet.");
|
|
}
|
|
}
|
|
|
|
#region --- IInputDriver Members ---
|
|
|
|
IList<IInputDevice> IInputDriver.InputDevices
|
|
{
|
|
get { return inputDriver.InputDevices; }
|
|
}
|
|
|
|
public IList<Keyboard> Keyboards
|
|
{
|
|
get { return inputDriver.Keyboards; }
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|