mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-25 12:36:55 +00:00
Removed obsolete legacy input driver.
This commit is contained in:
parent
094e79a570
commit
92141295cd
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights to
|
||||
// in the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
// the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
|
@ -91,7 +91,7 @@ namespace OpenTK
|
|||
|
||||
double update_period, render_period;
|
||||
double target_update_period, target_render_period;
|
||||
|
||||
|
||||
double update_time; // length of last UpdateFrame event
|
||||
double render_time; // length of last RenderFrame event
|
||||
|
||||
|
@ -462,7 +462,7 @@ namespace OpenTK
|
|||
while (elapsed > 0 && elapsed + update_epsilon >= TargetUpdatePeriod)
|
||||
{
|
||||
RaiseUpdateFrame(elapsed, ref timestamp);
|
||||
|
||||
|
||||
// Calculate difference (positive or negative) between
|
||||
// actual elapsed time and target elapsed time. We must
|
||||
// compensate for this difference.
|
||||
|
@ -594,38 +594,6 @@ namespace OpenTK
|
|||
|
||||
#endregion
|
||||
|
||||
#region Keyboard
|
||||
|
||||
#pragma warning disable 0612
|
||||
|
||||
/// <summary>
|
||||
/// Gets the primary Keyboard device, or null if no Keyboard exists.
|
||||
/// </summary>
|
||||
public KeyboardDevice Keyboard
|
||||
{
|
||||
get { return InputDriver.Keyboard.Count > 0 ? InputDriver.Keyboard[0] : null; }
|
||||
}
|
||||
|
||||
#pragma warning restore 0612
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mouse
|
||||
|
||||
#pragma warning disable 0612
|
||||
|
||||
/// <summary>
|
||||
/// Gets the primary Mouse device, or null if no Mouse exists.
|
||||
/// </summary>
|
||||
public MouseDevice Mouse
|
||||
{
|
||||
get { return InputDriver.Mouse.Count > 0 ? InputDriver.Mouse[0] : null; }
|
||||
}
|
||||
|
||||
#pragma warning restore 0612
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- GameWindow Timing ---
|
||||
|
||||
// TODO: Disabled because it is not reliable enough. Use vsync as a workaround.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights to
|
||||
// in the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
// the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
|
@ -37,7 +37,7 @@ using OpenTK.Platform;
|
|||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the interface for a native window.
|
||||
/// Defines the interface for a native window.
|
||||
/// </summary>
|
||||
public interface INativeWindow : IDisposable
|
||||
{
|
||||
|
@ -50,32 +50,32 @@ namespace OpenTK
|
|||
/// Gets or sets the title of the window.
|
||||
/// </summary>
|
||||
string Title { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.Boolean that indicates whether this window has input focus.
|
||||
/// </summary>
|
||||
bool Focused { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a System.Boolean that indicates whether the window is visible.
|
||||
/// </summary>
|
||||
bool Visible { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.Boolean that indicates whether the window has been created and has not been destroyed.
|
||||
/// </summary>
|
||||
bool Exists { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="OpenTK.Platform.IWindowInfo"/> for this window.
|
||||
/// </summary>
|
||||
IWindowInfo WindowInfo { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="OpenTK.WindowState"/> for this window.
|
||||
/// </summary>
|
||||
WindowState WindowState { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="OpenTK.WindowBorder"/> for this window.
|
||||
/// </summary>
|
||||
|
@ -86,54 +86,48 @@ namespace OpenTK
|
|||
/// External bounds include the title bar, borders and drawing area of the window.
|
||||
/// </summary>
|
||||
Rectangle Bounds { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a <see cref="System.Drawing.Point"/> structure that contains the location of this window on the desktop.
|
||||
/// </summary>
|
||||
Point Location { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a <see cref="System.Drawing.Size"/> structure that contains the external size of this window.
|
||||
/// </summary>
|
||||
Size Size { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the horizontal location of this window on the desktop.
|
||||
/// </summary>
|
||||
int X { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the vertical location of this window on the desktop.
|
||||
/// </summary>
|
||||
int Y { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the external width of this window.
|
||||
/// </summary>
|
||||
int Width { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the external height of this window.
|
||||
/// </summary>
|
||||
int Height { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a <see cref="System.Drawing.Rectangle"/> structure that contains the internal bounds of this window, in client coordinates.
|
||||
/// The internal bounds include the drawing area of the window, but exclude the titlebar and window borders.
|
||||
/// </summary>
|
||||
Rectangle ClientRectangle { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a <see cref="System.Drawing.Size"/> structure that contains the internal size this window.
|
||||
/// </summary>
|
||||
Size ClientSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This property is deprecated and should not be used.
|
||||
/// </summary>
|
||||
[Obsolete("Use OpenTK.Input.Mouse/Keyboard/Joystick/GamePad instead.")]
|
||||
OpenTK.Input.IInputDriver InputDriver { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="OpenTK.MouseCursor"/> for this window.
|
||||
/// </summary>
|
||||
|
@ -154,14 +148,14 @@ namespace OpenTK
|
|||
/// Closes this window.
|
||||
/// </summary>
|
||||
void Close();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Processes pending window events.
|
||||
/// </summary>
|
||||
void ProcessEvents();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Transforms the specified point from screen to client coordinates.
|
||||
/// Transforms the specified point from screen to client coordinates.
|
||||
/// </summary>
|
||||
/// <param name="point">
|
||||
/// A <see cref="System.Drawing.Point"/> to transform.
|
||||
|
@ -170,9 +164,9 @@ namespace OpenTK
|
|||
/// The point transformed to client coordinates.
|
||||
/// </returns>
|
||||
Point PointToClient(Point point);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Transforms the specified point from client to screen coordinates.
|
||||
/// Transforms the specified point from client to screen coordinates.
|
||||
/// </summary>
|
||||
/// <param name="point">
|
||||
/// A <see cref="System.Drawing.Point"/> to transform.
|
||||
|
@ -183,32 +177,32 @@ namespace OpenTK
|
|||
Point PointToScreen(Point point);
|
||||
|
||||
/// <summary>
|
||||
/// Occurs whenever the window is moved.
|
||||
/// Occurs whenever the window is moved.
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> Move;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs whenever the window is resized.
|
||||
/// Occurs whenever the window is resized.
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> Resize;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the window is about to close.
|
||||
/// Occurs when the window is about to close.
|
||||
/// </summary>
|
||||
event EventHandler<CancelEventArgs> Closing;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs after the window has closed.
|
||||
/// Occurs after the window has closed.
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> Closed;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the window is disposed.
|
||||
/// Occurs when the window is disposed.
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> Disposed;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the <see cref="Icon"/> property of the window changes.
|
||||
/// Occurs when the <see cref="Icon"/> property of the window changes.
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> IconChanged;
|
||||
|
||||
|
@ -246,7 +240,7 @@ namespace OpenTK
|
|||
/// Occurs whenever a character is typed.
|
||||
/// </summary>
|
||||
event EventHandler<KeyPressEventArgs> KeyPress;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Occurs whenever a keyboard key is released.
|
||||
/// </summary>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights to
|
||||
// in the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
// the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
|
@ -149,7 +149,7 @@ namespace OpenTK
|
|||
#region PointToClient
|
||||
|
||||
/// <summary>
|
||||
/// Transforms the specified point from screen to client coordinates.
|
||||
/// Transforms the specified point from screen to client coordinates.
|
||||
/// </summary>
|
||||
/// <param name="point">
|
||||
/// A <see cref="System.Drawing.Point"/> to transform.
|
||||
|
@ -367,23 +367,6 @@ namespace OpenTK
|
|||
|
||||
#endregion
|
||||
|
||||
#region InputDriver
|
||||
|
||||
/// <summary>
|
||||
/// This property is deprecated.
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
public IInputDriver InputDriver
|
||||
{
|
||||
get
|
||||
{
|
||||
EnsureUndisposed();
|
||||
return implementation.InputDriver;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Location
|
||||
|
||||
/// <summary>
|
||||
|
@ -630,7 +613,7 @@ namespace OpenTK
|
|||
public event EventHandler<EventArgs> FocusedChanged = delegate { };
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the <see cref="Icon"/> property of the window changes.
|
||||
/// Occurs when the <see cref="Icon"/> property of the window changes.
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> IconChanged = delegate { };
|
||||
|
||||
|
@ -658,7 +641,7 @@ namespace OpenTK
|
|||
/// Occurs whenever the mouse cursor enters the window <see cref="Bounds"/>.
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> MouseEnter = delegate { };
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Occurs whenever the mouse cursor leaves the window <see cref="Bounds"/>.
|
||||
/// </summary>
|
||||
|
|
|
@ -736,7 +736,6 @@
|
|||
<Compile Include="Platform\MacOS\Cocoa\NSOpenGLPixelFormatAttribute.cs" />
|
||||
<Compile Include="Platform\MacOS\Cocoa\NSOpenGLProfile.cs" />
|
||||
<Compile Include="Platform\MacOS\Cocoa\NSOpenGLContextParameter.cs" />
|
||||
<Compile Include="Platform\LegacyInputDriver.cs" />
|
||||
<Compile Include="Platform\MacOS\Cocoa\NSEventType.cs" />
|
||||
<Compile Include="Platform\MacOS\Cocoa\NSEventModifierMask.cs" />
|
||||
<Compile Include="Platform\MacOS\Cocoa\NSTrackingAreaOptions.cs" />
|
||||
|
|
|
@ -1,119 +0,0 @@
|
|||
#region License
|
||||
//
|
||||
// LegacyInputDriver.cs
|
||||
//
|
||||
// Author:
|
||||
// Stefanos A. <stapostol@gmail.com>
|
||||
//
|
||||
// Copyright (c) 2006-2014 Stefanos Apostolopoulos
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
//
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenTK.Input;
|
||||
|
||||
namespace OpenTK.Platform
|
||||
{
|
||||
// IInputDriver implementation to satisfy INativeWindow
|
||||
// while reducing code duplication.
|
||||
[Obsolete]
|
||||
class LegacyInputDriver : IInputDriver
|
||||
{
|
||||
List<KeyboardDevice> dummy_keyboard_list = new List<KeyboardDevice>(1);
|
||||
List<MouseDevice> dummy_mice_list = new List<MouseDevice>(1);
|
||||
|
||||
readonly LegacyJoystickDriver JoystickDriver = new LegacyJoystickDriver();
|
||||
|
||||
internal LegacyInputDriver(INativeWindow window)
|
||||
{
|
||||
if (window == null)
|
||||
throw new ArgumentNullException();
|
||||
|
||||
var mouse = new MouseDevice();
|
||||
mouse.Description = "Standard Mouse";
|
||||
mouse.NumberOfButtons = 3;
|
||||
mouse.NumberOfWheels = 1;
|
||||
dummy_mice_list.Add(mouse);
|
||||
|
||||
var keyboard = new KeyboardDevice();
|
||||
keyboard.Description = "Standard Keyboard";
|
||||
keyboard.NumberOfKeys = 101;
|
||||
keyboard.NumberOfLeds = 3;
|
||||
keyboard.NumberOfFunctionKeys = 12;
|
||||
dummy_keyboard_list.Add(keyboard);
|
||||
|
||||
// Hook mouse events
|
||||
window.MouseDown += mouse.HandleMouseDown;
|
||||
window.MouseUp += mouse.HandleMouseUp;
|
||||
window.MouseMove += mouse.HandleMouseMove;
|
||||
window.MouseWheel += mouse.HandleMouseWheel;
|
||||
|
||||
// Hook keyboard events
|
||||
window.KeyDown += keyboard.HandleKeyDown;
|
||||
window.KeyUp += keyboard.HandleKeyUp;
|
||||
}
|
||||
|
||||
#region IInputDriver Members
|
||||
|
||||
public void Poll()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IKeyboardDriver Members
|
||||
|
||||
public IList<KeyboardDevice> Keyboard
|
||||
{
|
||||
get { return dummy_keyboard_list; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IMouseDriver Members
|
||||
|
||||
public IList<MouseDevice> Mouse
|
||||
{
|
||||
get { return dummy_mice_list; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IJoystickDriver Members
|
||||
|
||||
public IList<JoystickDevice> Joysticks
|
||||
{
|
||||
get { return JoystickDriver.Joysticks; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -40,10 +40,6 @@ namespace OpenTK.Platform
|
|||
// Common base class for all INativeWindow implementations
|
||||
abstract class NativeWindowBase : INativeWindow
|
||||
{
|
||||
#pragma warning disable 612,618
|
||||
readonly LegacyInputDriver LegacyInputDriver;
|
||||
#pragma warning restore 612,618
|
||||
|
||||
readonly MouseButtonEventArgs MouseDownArgs = new MouseButtonEventArgs();
|
||||
readonly MouseButtonEventArgs MouseUpArgs = new MouseButtonEventArgs();
|
||||
readonly MouseMoveEventArgs MouseMoveArgs = new MouseMoveEventArgs();
|
||||
|
@ -62,9 +58,6 @@ namespace OpenTK.Platform
|
|||
|
||||
internal NativeWindowBase()
|
||||
{
|
||||
#pragma warning disable 612,618
|
||||
LegacyInputDriver = new LegacyInputDriver(this);
|
||||
#pragma warning restore 612,618
|
||||
MouseState.SetIsConnected(true);
|
||||
KeyboardState.SetIsConnected(true);
|
||||
PreviousMouseState.SetIsConnected(true);
|
||||
|
@ -448,15 +441,6 @@ namespace OpenTK.Platform
|
|||
|
||||
public abstract Size ClientSize { get; set; }
|
||||
|
||||
[Obsolete]
|
||||
public virtual IInputDriver InputDriver
|
||||
{
|
||||
get
|
||||
{
|
||||
return LegacyInputDriver;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract bool CursorVisible { get; set; }
|
||||
|
||||
public abstract MouseCursor Cursor { get; set; }
|
||||
|
|
Loading…
Reference in a new issue