[Input] Added JoystickAxis/Button.Last; added JoystickAxis.Axis10.

JoystickAxis/Button.Last is used internally to allocate the correct
amount of storage for joystick axes and buttons. JoystickAxis.Axis10 is
required to support the maximum number of axes available on Mac OS X.
This commit is contained in:
thefiddler 2014-01-05 03:54:34 +01:00
parent 59249c2624
commit 92635b3f35
3 changed files with 9 additions and 3 deletions

View file

@ -5,7 +5,7 @@
// Author:
// Stefanos A. <stapostol@gmail.com>
//
// Copyright (c) 2006-2013 Stefanos Apostolopoulos
// 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
@ -58,5 +58,9 @@ namespace OpenTK.Input
Axis8,
/// <summary>The tenth axis of the JoystickDevice.</summary>
Axis9,
/// <summary>The eleventh axis of the JoystickDevice.</summary>
Axis10,
/// <summary>The highest supported axis of the JoystickDevice.</summary>
Last = Axis10,
}
}

View file

@ -70,5 +70,7 @@ namespace OpenTK.Input
Button14,
/// <summary>The sixteenth button of the JoystickDevice.</summary>
Button15,
/// <summary>The last supported button of the JoystickDevice.</summary>
Last = Button15,
}
}

View file

@ -40,8 +40,8 @@ namespace OpenTK.Input
{
// If we ever add more values to JoystickAxis or JoystickButton
// then we'll need to increase these limits.
internal const int MaxAxes = 10;
internal const int MaxButtons = 32;
internal const int MaxAxes = (int)JoystickAxis.Last;
internal const int MaxButtons = (int)JoystickButton.Last;
const float ConversionFactor = 1.0f / (short.MaxValue + 0.5f);