|
SDL3pp
A slim C++ wrapper for SDL3
|
The structure used to identify an SDL gamepad. More...
Public Member Functions | |
| constexpr | Gamepad (GamepadRaw resource) noexcept |
| Constructs from raw Gamepad. | |
| constexpr | Gamepad (const Gamepad &other)=delete |
| Copy constructor. | |
| constexpr | Gamepad (Gamepad &&other) noexcept |
| Move constructor. | |
| constexpr | Gamepad (const GamepadRef &other)=delete |
| constexpr | Gamepad (GamepadRef &&other)=delete |
| Gamepad (JoystickID instance_id) | |
| Open a gamepad for use. | |
| ~Gamepad () | |
| Destructor. | |
| constexpr Gamepad & | operator= (Gamepad &&other) noexcept |
| Assignment operator. | |
| Gamepad & | operator= (const Gamepad &other)=delete |
| Assignment operator. | |
| void | Close () |
| Close a gamepad previously opened with OpenGamepad(). | |
| StringResult | GetMapping () |
| Get the current mapping of a gamepad. | |
| PropertiesRef | GetProperties () |
| Get the properties associated with an opened gamepad. | |
| JoystickID | GetID () |
| Get the instance ID of an opened gamepad. | |
| const char * | GetName () |
| Get the implementation-dependent name for an opened gamepad. | |
| const char * | GetPath () |
| Get the implementation-dependent path for an opened gamepad. | |
| GamepadType | GetType () |
| Get the type of an opened gamepad. | |
| GamepadType | GetRealType () |
| Get the type of an opened gamepad, ignoring any mapping override. | |
| int | GetPlayerIndex () |
| Get the player index of an opened gamepad. | |
| void | SetPlayerIndex (int player_index) |
| Set the player index of an opened gamepad. | |
| Uint16 | GetVendor () |
| Get the USB vendor ID of an opened gamepad, if available. | |
| Uint16 | GetProduct () |
| Get the USB product ID of an opened gamepad, if available. | |
| Uint16 | GetProductVersion () |
| Get the product version of an opened gamepad, if available. | |
| Uint16 | GetFirmwareVersion () |
| Get the firmware version of an opened gamepad, if available. | |
| const char * | GetSerial () |
| Get the serial number of an opened gamepad, if available. | |
| Uint64 | GetSteamHandle () |
| Get the Steam Input handle of an opened gamepad, if available. | |
| JoystickConnectionState | GetConnectionState () |
| Get the connection state of a gamepad. | |
| PowerState | GetPowerInfo (int *percent) |
| Get the battery state of a gamepad. | |
| bool | Connected () |
| Check if a gamepad has been opened and is currently connected. | |
| JoystickRef | GetJoystick () |
| Get the underlying joystick from a gamepad. | |
| OwnArray< GamepadBinding * > | GetBindings () |
| Get the SDL joystick layer bindings for a gamepad. | |
| bool | HasAxis (GamepadAxis axis) |
| Query whether a gamepad has a given axis. | |
| Sint16 | GetAxis (GamepadAxis axis) |
| Get the current state of an axis control on a gamepad. | |
| bool | HasButton (GamepadButton button) |
| Query whether a gamepad has a given button. | |
| bool | GetButton (GamepadButton button) |
| Get the current state of a button on a gamepad. | |
| GamepadButtonLabel | GetButtonLabel (GamepadButton button) |
| Get the label of a button on a gamepad. | |
| int | GetNumTouchpads () |
| Get the number of touchpads on a gamepad. | |
| int | GetNumTouchpadFingers (int touchpad) |
| Get the number of supported simultaneous fingers on a touchpad on a game gamepad. | |
| void | GetTouchpadFinger (int touchpad, int finger, bool *down, float *x, float *y, float *pressure) |
| Get the current state of a finger on a touchpad on a gamepad. | |
| bool | HasSensor (SensorType type) |
| Return whether a gamepad has a particular sensor. | |
| void | SetSensorEnabled (SensorType type, bool enabled) |
| Set whether data reporting for a gamepad sensor is enabled. | |
| bool | SensorEnabled (SensorType type) |
| Query whether sensor data reporting is enabled for a gamepad. | |
| float | GetSensorDataRate (SensorType type) |
| Get the data rate (number of events per second) of a gamepad sensor. | |
| void | GetSensorData (SensorType type, float *data, int num_values) |
| Get the current state of a gamepad sensor. | |
| void | Rumble (Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) |
| Start a rumble effect on a gamepad. | |
| void | RumbleTriggers (Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) |
| Start a rumble effect in the gamepad's triggers. | |
| void | SetLED (Uint8 red, Uint8 green, Uint8 blue) |
| Update a gamepad's LED color. | |
| void | SendEffect (const void *data, int size) |
| Send a gamepad specific effect packet. | |
| const char * | GetAppleSFSymbolsNameForButton (GamepadButton button) |
| Return the sfSymbolsName for a given button on a gamepad on Apple platforms. | |
| const char * | GetAppleSFSymbolsNameForAxis (GamepadAxis axis) |
| Return the sfSymbolsName for a given axis on a gamepad on Apple platforms. | |
| constexpr | ResourceBase (RawPointer resource) |
| Constructs from resource pointer. | |
| constexpr | ResourceBase (std::nullptr_t=nullptr) |
| Constructs null/invalid. | |
| Public Member Functions inherited from SDL::ResourceBase< GamepadRaw > | |
| constexpr | ResourceBase (RawPointer resource) |
| Constructs from resource pointer. | |
| constexpr | operator bool () const |
| Converts to bool. | |
| constexpr auto | operator<=> (const ResourceBase &other) const=default |
| Comparison. | |
| constexpr RawConstPointer | operator-> () const noexcept |
| member access to underlying resource pointer. | |
| constexpr RawPointer | get () const noexcept |
| Retrieves underlying resource pointer. | |
| constexpr RawPointer | release () noexcept |
| Retrieves underlying resource pointer and clear this. | |
Additional Inherited Members | |
| Public Types inherited from SDL::ResourceBase< GamepadRaw > | |
| using | RawPointer |
| The underlying raw pointer type. | |
| using | RawConstPointer |
| The underlying const raw pointer type. | |
The structure used to identify an SDL gamepad.
|
inlineexplicitconstexprnoexcept |
Constructs from raw Gamepad.
| resource | a GamepadRaw to be wrapped. |
This assumes the ownership, call release() if you need to take back.