mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 21:21:17 +01:00
Adds a RIVE_MAKE_ENUM_BITFIELD() macro and accompanying EnumBitset<> class that allow us to treat strongly typed C++ enums as bitsets, including with an implicit bool conversion for expressions like "if (flags & Flags::myFlag)". Diffs= 654d4488e Add a macro to create bitsets from enums (#5922) Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
22 lines
465 B
C++
22 lines
465 B
C++
#ifndef _RIVE_JOYSTICK_FLAGS_HPP_
|
|
#define _RIVE_JOYSTICK_FLAGS_HPP_
|
|
|
|
#include "rive/enum_bitset.hpp"
|
|
|
|
namespace rive
|
|
{
|
|
enum class JoystickFlags : unsigned char
|
|
{
|
|
/// Whether to invert the application of the x axis.
|
|
invertX = 1 << 0,
|
|
|
|
/// Whether to invert the application of the y axis.
|
|
invertY = 1 << 1,
|
|
|
|
/// Whether this Joystick works in world space.
|
|
worldSpace = 1 << 2
|
|
};
|
|
RIVE_MAKE_ENUM_BITSET(JoystickFlags)
|
|
} // namespace rive
|
|
#endif
|