SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL::JoystickBase Struct Reference

Base class to Joystick. More...

Inheritance diagram for SDL::JoystickBase:
[legend]

Public Member Functions

void Close ()
 Close a joystick previously opened with 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 ResourceBaseT ()=default
 Default constructor, creates null/invalid resource.
constexpr ResourceBaseT (RawPointer resource)
 Constructs from resource pointer.
constexpr ResourceBaseT (std::nullptr_t)
 Constructs null/invalid.
constexpr ResourceBaseT (const ResourceBaseT &)=default
 Copy constructor.
constexpr ResourceBaseT (ResourceBaseT &&) noexcept=default
 Move constructor.
Public Member Functions inherited from SDL::ResourceBaseT< JoystickRaw >
constexpr ResourceBaseT ()=default
 Default constructor, creates null/invalid resource.
constexpr operator bool () const
 Converts to bool.
constexpr auto operator<=> (const ResourceBaseT &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::ResourceBaseT< JoystickRaw >
using RawPointer
 The underlying raw pointer type.
using RawConstPointer
 The underlying const raw pointer type.
Protected Member Functions inherited from SDL::ResourceBaseT< JoystickRaw >
constexpr ~ResourceBaseT ()=default
 Destructor.
constexpr ResourceBaseToperator= (const ResourceBaseT &)=default
 Assignment operator.

Detailed Description

Base class to Joystick.

See also
Joystick

The documentation for this struct was generated from the following file: