Use std::bitset

This commit is contained in:
Chris Thrasher 2024-12-09 11:56:39 -07:00
parent 20d57becf4
commit 0c3a64f437
No known key found for this signature in database
GPG Key ID: 56FB686C9DFC8E2C

View File

@ -33,6 +33,8 @@
#include <SFML/System/EnumArray.hpp> #include <SFML/System/EnumArray.hpp>
#include <bitset>
namespace sf::priv namespace sf::priv
{ {
@ -55,7 +57,7 @@ struct JoystickState
{ {
bool connected{}; //!< Is the joystick currently connected? bool connected{}; //!< Is the joystick currently connected?
EnumArray<Joystick::Axis, float, Joystick::AxisCount> axes{}; //!< Position of each axis, in range [-100, 100] EnumArray<Joystick::Axis, float, Joystick::AxisCount> axes{}; //!< Position of each axis, in range [-100, 100]
std::array<bool, Joystick::ButtonCount> buttons{}; //!< Status of each button (true = pressed) std::bitset<Joystick::ButtonCount> buttons; //!< Status of each button (true = pressed)
}; };
} // namespace sf::priv } // namespace sf::priv