* Source/OpenTK/Input/Mouse.cs:
* Source/OpenTK/Platform/Factory.cs: * Source/OpenTK/Input/InputDriver.cs: * Source/OpenTK/Input/IMouseDriver.cs: * Source/OpenTK/Platform/X11/X11Input.cs: * Source/OpenTK/Platform/X11/X11Factory.cs: * Source/OpenTK/Platform/Windows/WMInput.cs: * Source/OpenTK/Platform/IPlatformFactory.cs: * Source/OpenTK/Platform/MacOS/CarbonInput.cs: * Source/OpenTK/Platform/Windows/WinFactory.cs: * Source/OpenTK/Platform/MacOS/MacOSFactory.cs: * Source/OpenTK/Platform/Windows/WinGLNative.cs: * Source/OpenTK/Platform/Windows/WinRawMouse.cs: * Source/OpenTK/Platform/Windows/WinRawInput.cs: Added new MouseDriver interface and added stub internal implementations.
This commit is contained in:
parent
e801660ff7
commit
86588ea60c
14 changed files with 126 additions and 13 deletions
|
@ -19,5 +19,18 @@ namespace OpenTK.Input
|
|||
/// Gets the list of available MouseDevices.
|
||||
/// </summary>
|
||||
IList<MouseDevice> Mouse { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the MouseState for the default keyboard device.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="OpenTK.Input.MouseState"/> structure containing the state of the mouse device.</returns>
|
||||
MouseState GetState();
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the MouseState for the specified keyboard device.
|
||||
/// </summary>
|
||||
/// <param name="index">The index of the keyboard device.</param>
|
||||
/// <returns>A <see cref="OpenTK.Input.MouseState"/> structure containing the state of the mouse device.</returns>
|
||||
MouseState GetState(int index);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,12 +75,12 @@ namespace OpenTK
|
|||
|
||||
public KeyboardState GetState()
|
||||
{
|
||||
return inputDriver.GetState();
|
||||
return (inputDriver as IKeyboardDriver).GetState();
|
||||
}
|
||||
|
||||
public KeyboardState GetState(int index)
|
||||
{
|
||||
return inputDriver.GetState(index);
|
||||
return (inputDriver as IKeyboardDriver).GetState(index);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -92,6 +92,16 @@ namespace OpenTK
|
|||
get { return inputDriver.Mouse; }
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- IJoystickDriver Members ---
|
||||
|
|
|
@ -38,20 +38,22 @@ namespace OpenTK.Input
|
|||
{
|
||||
#region Fields
|
||||
|
||||
//static IMouseDriver driver;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
static Mouse()
|
||||
{
|
||||
}
|
||||
static readonly IMouseDriver driver =
|
||||
Platform.Factory.Default.CreateMouseDriver();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the MouseState for the specified mouse device.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="OpenTK.Input.MouseState"/> structure containing the state of the mouse device.</returns>
|
||||
public static MouseState GetState()
|
||||
{
|
||||
return driver.GetState();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the MouseState for the specified mouse device.
|
||||
/// </summary>
|
||||
|
@ -59,7 +61,7 @@ namespace OpenTK.Input
|
|||
/// <returns>A <see cref="OpenTK.Input.MouseState"/> structure containing the state of the mouse device.</returns>
|
||||
public static MouseState GetState(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return driver.GetState(index);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -119,6 +119,11 @@ namespace OpenTK.Platform
|
|||
return default_implementation.CreateKeyboardDriver();
|
||||
}
|
||||
|
||||
public OpenTK.Input.IMouseDriver CreateMouseDriver()
|
||||
{
|
||||
return default_implementation.CreateMouseDriver();
|
||||
}
|
||||
|
||||
class UnsupportedPlatform : IPlatformFactory
|
||||
{
|
||||
#region Fields
|
||||
|
@ -168,6 +173,11 @@ namespace OpenTK.Platform
|
|||
{
|
||||
throw new PlatformNotSupportedException(error_string);
|
||||
}
|
||||
|
||||
public OpenTK.Input.IMouseDriver CreateMouseDriver()
|
||||
{
|
||||
throw new PlatformNotSupportedException(error_string);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -48,5 +48,7 @@ namespace OpenTK.Platform
|
|||
IGraphicsMode CreateGraphicsMode();
|
||||
|
||||
OpenTK.Input.IKeyboardDriver CreateKeyboardDriver();
|
||||
|
||||
OpenTK.Input.IMouseDriver CreateMouseDriver();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,6 +54,16 @@ namespace OpenTK.Platform.MacOS
|
|||
get { return dummy_mice_list; }
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IJoystickDriver Members
|
||||
|
|
|
@ -74,7 +74,12 @@ namespace OpenTK.Platform.MacOS
|
|||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
public virtual OpenTK.Input.IMouseDriver CreateMouseDriver()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -265,6 +265,16 @@ namespace OpenTK.Platform.Windows
|
|||
get { return mice; }
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IJoystickDriver Members
|
||||
|
|
|
@ -80,6 +80,11 @@ namespace OpenTK.Platform.Windows
|
|||
else
|
||||
return new WMInput(null);
|
||||
}
|
||||
|
||||
public virtual OpenTK.Input.IMouseDriver CreateMouseDriver()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -1205,6 +1205,16 @@ namespace OpenTK.Platform.Windows
|
|||
get { return mice; }
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IJoystickDriver Members
|
||||
|
|
|
@ -226,6 +226,16 @@ namespace OpenTK.Platform.Windows
|
|||
get { return mouseDriver.Mouse; }
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IJoystickDriver Members
|
||||
|
|
|
@ -52,6 +52,16 @@ namespace OpenTK.Platform.Windows
|
|||
get { return mice; }
|
||||
}
|
||||
|
||||
public MouseState GetState()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public MouseState GetState(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#region public int RegisterDevices()
|
||||
|
||||
public int RegisterDevices()
|
||||
|
|
|
@ -83,6 +83,12 @@ namespace OpenTK.Platform.X11
|
|||
return new X11Keyboard(null);
|
||||
}
|
||||
|
||||
public virtual OpenTK.Input.IMouseDriver CreateMouseDriver()
|
||||
{
|
||||
//return new X11Mouse(null);
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -238,6 +238,16 @@ namespace OpenTK.Platform.X11
|
|||
get { return (IList<MouseDevice>)dummy_mice_list; } //return mouseDriver.Mouse;
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
MouseState IMouseDriver.GetState(int index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public IList<JoystickDevice> Joysticks
|
||||
|
|
Loading…
Reference in a new issue