From 92635b3f3566d04f5620c6b98a70aae6395526eb Mon Sep 17 00:00:00 2001 From: thefiddler Date: Sun, 5 Jan 2014 03:54:34 +0100 Subject: [PATCH] [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. --- Source/OpenTK/Input/JoystickAxis.cs | 6 +++++- Source/OpenTK/Input/JoystickButton.cs | 2 ++ Source/OpenTK/Input/JoystickState.cs | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/OpenTK/Input/JoystickAxis.cs b/Source/OpenTK/Input/JoystickAxis.cs index 1e166e66..751ec7bd 100644 --- a/Source/OpenTK/Input/JoystickAxis.cs +++ b/Source/OpenTK/Input/JoystickAxis.cs @@ -5,7 +5,7 @@ // Author: // Stefanos A. // -// 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, /// The tenth axis of the JoystickDevice. Axis9, + /// The eleventh axis of the JoystickDevice. + Axis10, + /// The highest supported axis of the JoystickDevice. + Last = Axis10, } } diff --git a/Source/OpenTK/Input/JoystickButton.cs b/Source/OpenTK/Input/JoystickButton.cs index e8daf6ed..2ab2b88a 100644 --- a/Source/OpenTK/Input/JoystickButton.cs +++ b/Source/OpenTK/Input/JoystickButton.cs @@ -70,5 +70,7 @@ namespace OpenTK.Input Button14, /// The sixteenth button of the JoystickDevice. Button15, + /// The last supported button of the JoystickDevice. + Last = Button15, } } diff --git a/Source/OpenTK/Input/JoystickState.cs b/Source/OpenTK/Input/JoystickState.cs index f5f533a2..8005b096 100644 --- a/Source/OpenTK/Input/JoystickState.cs +++ b/Source/OpenTK/Input/JoystickState.cs @@ -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);