#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_INPUT_DEVICES_GAMEPADSTATE_H #define NUCLEX_INPUT_DEVICES_GAMEPADSTATE_H #include "../Config.h" #include "Axes.h" #include "Sliders.h" #include "DirectionalPad.h" #include namespace Nuclex { namespace Input { namespace Devices { // ------------------------------------------------------------------------------------------- // /// Complete state of a game pad or joystick struct GamePadState { /// Returns the number of sliders actually present on the game pad /// The number of sliders present on the game pad public: NUCLEX_INPUT_API std::size_t CountSliders() const; /// Returns the number of axes actually present on the game pad /// The number of axes present on the game pad public: NUCLEX_INPUT_API std::size_t CountAxes() const; /// Resets the game pad state to a neutral state public: NUCLEX_INPUT_API void Reset(); /// Stores the state of up to 128 buttons on the game pad /// /// Unused buttons are guaranteed to be set to false (unpressed). /// public: std::bitset<128> Buttons; /// The actual number of buttons on the game pad public: std::size_t ButtonCount; /// Stores the state of up to 8 sliders on the game pad public: float Sliders[8]; /// Sliders actually provided by the game pad public: Sliders::Enum SliderMask; /// Stores the state of up to 24 two-direction axes public: float Axes[24]; /// Two-direction axes actually provided by the game pad public: Axes::Enum AxisMask; /// State of any PoV hats or directional pads on the game pad public: DirectionalPad DirectionalPads[4]; /// Number of directional pads on the game pad public: std::size_t DirectionalPadCount; }; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Input::Devices #endif // NUCLEX_INPUT_DEVICES_GAMEPADSTATE_H