const double MaxFrequency = 500.0; // Frequency cap for Update/RenderFrame events
readonly Stopwatch watch = new Stopwatch();
+
+ #pragma warning disable 612,618
readonly IJoystickDriver LegacyJoystick =
Factory.Default.CreateLegacyJoystickDriver();
+ #pragma warning restore 612,618
+
IGraphicsContext glContext;
/// <summary>
/// Defines the interface for an input driver.
/// </summary>
+ [Obsolete("This interface has been replaced by OpenTK.Input.Keyboard, Mouse, Joystick and GamePad.")]
public interface IInputDriver : IKeyboardDriver, IMouseDriver, IJoystickDriver, IDisposable
{
/// <summary>
return default_implementation.CreateJoystickDriver();
}
+ [Obsolete]
public IJoystickDriver CreateLegacyJoystickDriver()
{
return default_implementation.CreateLegacyJoystickDriver();
Input.IJoystickDriver2 CreateJoystickDriver();
+ [Obsolete]
Input.IJoystickDriver CreateLegacyJoystickDriver();
}
}
{
// IInputDriver implementation to satisfy INativeWindow
// while reducing code duplication.
+ [Obsolete]
class LegacyInputDriver : IInputDriver
{
List<KeyboardDevice> dummy_keyboard_list = new List<KeyboardDevice>(1);
private int normalLevel;
private bool shouldClose;
private int suppressResize;
- private bool cursorInsideWindow = true;
private MouseCursor selectedCursor = MouseCursor.Default; // user-selected cursor
public CocoaNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device)
// 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();
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);
public abstract Size ClientSize { get; set; }
+ [Obsolete]
public virtual IInputDriver InputDriver
{
get
public abstract IJoystickDriver2 CreateJoystickDriver();
+ [Obsolete]
public virtual IJoystickDriver CreateLegacyJoystickDriver()
{
return new LegacyJoystickDriver();
else
{
// Exclude the current position.
- Point currentScreenPosition = new Point(InputDriver.Mouse[0].X, InputDriver.Mouse[0].Y);
+ Point currentScreenPosition = new Point(MouseState.X, MouseState.Y);
Functions.ClientToScreen(handle, ref currentScreenPosition);
// Find the first move point we've already seen.
wc.WndProc = WindowProcedureDelegate;
wc.ClassName = ClassName;
wc.Icon = Icon != null ? Icon.Handle : IntPtr.Zero;
-#warning "This seems to resize one of the 'large' icons, rather than using a small icon directly (multi-icon files). Investigate!"
+ // Todo: the following line appears to resize one of the 'large' icons, rather than using a small icon directly (multi-icon files). Investigate!
wc.IconSm = Icon != null ? new Icon(Icon, 16, 16).Handle : IntPtr.Zero;
wc.Cursor = Functions.LoadCursor(CursorName.Arrow);
ushort atom = Functions.RegisterClassEx(ref wc);
if (height <= 0)
throw new ArgumentOutOfRangeException("height", "Must be higher than zero.");
- XVisualInfo info = new XVisualInfo();
-
Debug.Indent();
-
+
using (new XLock(window.Display))
{
IntPtr visual;