Cleaned up a number of obsolete warnings
authorthefiddler <stapostol@gmail.com>
Mon, 21 Jul 2014 14:39:58 +0000 (16:39 +0200)
committerthefiddler <stapostol@gmail.com>
Mon, 21 Jul 2014 14:39:58 +0000 (16:39 +0200)
Source/OpenTK/GameWindow.cs
Source/OpenTK/Input/IInputDriver.cs
Source/OpenTK/Platform/Factory.cs
Source/OpenTK/Platform/IPlatformFactory.cs
Source/OpenTK/Platform/LegacyInputDriver.cs
Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs
Source/OpenTK/Platform/NativeWindowBase.cs
Source/OpenTK/Platform/PlatformFactoryBase.cs
Source/OpenTK/Platform/Windows/WinGLNative.cs
Source/OpenTK/Platform/X11/X11GLNative.cs

index 41029bc..f9a1562 100644 (file)
@@ -78,8 +78,12 @@ namespace OpenTK
         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;
 
index 594c1b3..c5b320b 100644 (file)
@@ -13,6 +13,7 @@ namespace OpenTK.Input
     /// <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>
index 2bcfada..031dcf8 100644 (file)
@@ -152,6 +152,7 @@ namespace OpenTK.Platform
             return default_implementation.CreateJoystickDriver();
         }
 
+        [Obsolete]
         public IJoystickDriver CreateLegacyJoystickDriver()
         {
             return default_implementation.CreateLegacyJoystickDriver();
index f9ec706..34effb7 100644 (file)
@@ -53,6 +53,7 @@ namespace OpenTK.Platform
 
         Input.IJoystickDriver2 CreateJoystickDriver();
 
+        [Obsolete]
         Input.IJoystickDriver CreateLegacyJoystickDriver();
     }
 }
index e2ee530..4d5bc4b 100644 (file)
@@ -35,6 +35,7 @@ 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);
index d187f1a..834e048 100644 (file)
@@ -141,7 +141,6 @@ namespace OpenTK.Platform.MacOS
         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)
index 90e53a8..a6ba2c2 100644 (file)
@@ -38,7 +38,9 @@ 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();
@@ -58,7 +60,9 @@ 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);
@@ -445,6 +449,7 @@ namespace OpenTK.Platform
 
         public abstract Size ClientSize { get; set; }
 
+        [Obsolete]
         public virtual IInputDriver InputDriver
         {
             get
index aa518e2..40dc0c1 100644 (file)
@@ -74,6 +74,7 @@ namespace OpenTK.Platform
 
         public abstract IJoystickDriver2 CreateJoystickDriver();
 
+        [Obsolete]
         public virtual IJoystickDriver CreateLegacyJoystickDriver()
         {
             return new LegacyJoystickDriver();
index fdcc14b..eb348c8 100644 (file)
@@ -444,7 +444,7 @@ namespace OpenTK.Platform.Windows
                 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.
@@ -867,7 +867,7 @@ namespace OpenTK.Platform.Windows
                 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);
index 2ee94bb..70bb62f 100644 (file)
@@ -140,10 +140,8 @@ namespace OpenTK.Platform.X11
             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;