[Input] Added internal Joystick.GetAxisRaw() method
authorthefiddler <stapostol@gmail.com>
Thu, 2 Jan 2014 17:36:27 +0000 (18:36 +0100)
committerthefiddler <stapostol@gmail.com>
Thu, 2 Jan 2014 17:36:27 +0000 (18:36 +0100)
Source/OpenTK/Input/JoystickState.cs

index e14ac2d..7f1624d 100644 (file)
@@ -56,16 +56,7 @@ namespace OpenTK.Input
 
         public float GetAxis(int axis)
         {
-            float value = 0.0f;
-            if (axis >= 0 && axis < MaxAxes)
-            {
-                value = GetAxisUnsafe(axis) * ConversionFactor;
-            }
-            else
-            {
-                Debug.Print("[Joystick] Invalid axis {0}", axis);
-            }
-            return value;
+            return GetAxisRaw(axis) * ConversionFactor;
         }
 
         public ButtonState GetButton(JoystickButton button)
@@ -124,6 +115,25 @@ namespace OpenTK.Input
 
         #region Internal Members
 
+        internal short GetAxisRaw(JoystickAxis axis)
+        {
+            return GetAxisRaw((int)axis);
+        }
+
+        internal short GetAxisRaw(int axis)
+        {
+            short value = 0;
+            if (axis >= 0 && axis < MaxAxes)
+            {
+                value = GetAxisUnsafe(axis);
+            }
+            else
+            {
+                Debug.Print("[Joystick] Invalid axis {0}", axis);
+            }
+            return value;
+        }
+
         internal void SetAxis(JoystickAxis axis, short value)
         {
             int index = (int)axis;