|
SDL3pp
A slim C++ wrapper for SDL3
|
The joystick structure used to identify an SDL joystick. More...
Public Member Functions | |
| constexpr | Joystick (JoystickRaw resource) noexcept |
| Constructs from raw Joystick. | |
| constexpr | Joystick (const Joystick &other)=delete |
| Copy constructor. | |
| constexpr | Joystick (Joystick &&other) noexcept |
| Move constructor. | |
| constexpr | Joystick (const JoystickRef &other)=delete |
| constexpr | Joystick (JoystickRef &&other)=delete |
| Joystick (JoystickID instance_id) | |
| Open a joystick for use. | |
| ~Joystick () | |
| Destructor. | |
| constexpr Joystick & | operator= (Joystick &&other) noexcept |
| Assignment operator. | |
| Joystick & | operator= (const Joystick &other)=delete |
| Assignment operator. | |
| void | Close () |
| Close a joystick previously opened with JoystickID.OpenJoystick(). | |
| void | SetVirtualAxis (int axis, Sint16 value) |
| Set the state of an axis on an opened virtual joystick. | |
| void | SetVirtualBall (int ball, Sint16 xrel, Sint16 yrel) |
| Generate ball motion on an opened virtual joystick. | |
| void | SetVirtualButton (int button, bool down) |
| Set the state of a button on an opened virtual joystick. | |
| void | SetVirtualHat (int hat, Uint8 value) |
| Set the state of a hat on an opened virtual joystick. | |
| void | SetVirtualTouchpad (int touchpad, int finger, bool down, const FPointRaw &p, float pressure) |
| Set touchpad finger state on an opened virtual joystick. | |
| void | SendVirtualSensorData (SensorType type, Uint64 sensor_timestamp, const float *data, int num_values) |
| Send a sensor update for an opened virtual joystick. | |
| PropertiesRef | GetProperties () |
| Get the properties associated with a joystick. | |
| const char * | GetName () |
| Get the implementation dependent name of a joystick. | |
| const char * | GetPath () |
| Get the implementation dependent path of a joystick. | |
| int | GetPlayerIndex () |
| Get the player index of an opened joystick. | |
| void | SetPlayerIndex (int player_index) |
| Set the player index of an opened joystick. | |
| GUID | GetGUID () |
| Get the implementation-dependent GUID for the joystick. | |
| Uint16 | GetVendor () |
| Get the USB vendor ID of an opened joystick, if available. | |
| Uint16 | GetProduct () |
| Get the USB product ID of an opened joystick, if available. | |
| Uint16 | GetProductVersion () |
| Get the product version of an opened joystick, if available. | |
| Uint16 | GetFirmwareVersion () |
| Get the firmware version of an opened joystick, if available. | |
| const char * | GetSerial () |
| Get the serial number of an opened joystick, if available. | |
| JoystickType | GetType () |
| Get the type of an opened joystick. | |
| bool | Connected () |
| Get the status of a specified joystick. | |
| JoystickID | GetID () |
| Get the instance ID of an opened joystick. | |
| int | GetNumAxes () |
| Get the number of general axis controls on a joystick. | |
| int | GetNumBalls () |
| Get the number of trackballs on a joystick. | |
| int | GetNumHats () |
| Get the number of POV hats on a joystick. | |
| int | GetNumButtons () |
| Get the number of buttons on a joystick. | |
| Sint16 | GetAxis (int axis) |
| Get the current state of an axis control on a joystick. | |
| bool | GetAxisInitialState (int axis, Sint16 *state) |
| Get the initial state of an axis control on a joystick. | |
| void | GetBall (int ball, int *dx, int *dy) |
| Get the ball axis change since the last poll. | |
| Uint8 | GetHat (int hat) |
| Get the current state of a POV hat on a joystick. | |
| bool | GetButton (int button) |
| Get the current state of a button on a joystick. | |
| bool | Rumble (Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) |
| Start a rumble effect. | |
| void | RumbleTriggers (Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) |
| Start a rumble effect in the joystick's triggers. | |
| void | SetLED (Uint8 red, Uint8 green, Uint8 blue) |
| Update a joystick's LED color. | |
| void | SendEffect (const void *data, int size) |
| Send a joystick specific effect packet. | |
| JoystickConnectionState | GetConnectionState () |
| Get the connection state of a joystick. | |
| PowerState | GetPowerInfo (int *percent) |
| Get the battery state of a joystick. | |
| constexpr | ResourceBase (RawPointer resource) |
| Constructs from resource pointer. | |
| constexpr | ResourceBase (std::nullptr_t=nullptr) |
| Constructs null/invalid. | |
| Public Member Functions inherited from SDL::ResourceBase< JoystickRaw > | |
| 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< JoystickRaw > | |
| using | RawPointer |
| The underlying raw pointer type. | |
| using | RawConstPointer |
| The underlying const raw pointer type. | |
The joystick structure used to identify an SDL joystick.
This is opaque data.
|
inlineexplicitconstexprnoexcept |
Constructs from raw Joystick.
| resource | a JoystickRaw to be wrapped. |
This assumes the ownership, call release() if you need to take back.