Files
rive-cpp/include/rive/joystick_flags.hpp
csmartdalton 50777ba55f Add a macro to create bitsets from enums
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>
2023-08-31 02:16:33 +00:00

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