SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::JoystickRef Struct Reference

Semi-safe reference for Joystick.

Inheritance diagram for SDL::JoystickRef:
Inheritance graph
[legend]
Collaboration diagram for SDL::JoystickRef:
Collaboration graph
[legend]

Public Member Functions

 JoystickRef (JoystickParam resource)
 Constructs from JoystickParam. More...
 
 JoystickRef (const JoystickRef &other)
 Copy constructor.
 
 ~JoystickRef ()
 Destructor.
 
- Public Member Functions inherited from SDL::Joystick
constexpr Joystick ()=default
 Default ctor.
 
constexpr Joystick (const JoystickRaw resource)
 Constructs from JoystickParam. More...
 
constexpr Joystick (const Joystick &other)=delete
 Copy constructor.
 
constexpr Joystick (Joystick &&other)
 Move constructor.
 
constexpr Joystick (const JoystickRef &other)=delete
 
constexpr Joystick (JoystickRef &&other)=delete
 
 Joystick (JoystickID instance_id)
 Open a joystick for use. More...
 
 ~Joystick ()
 Destructor.
 
Joystickoperator= (Joystick other)
 Assignment operator.
 
constexpr JoystickRaw get () const
 Retrieves underlying JoystickRaw.
 
constexpr JoystickRaw release ()
 Retrieves underlying JoystickRaw and clear this.
 
constexpr auto operator<=> (const Joystick &other) const =default
 Comparison.
 
constexpr bool operator== (std::nullptr_t _) const
 Comparison.
 
constexpr operator bool () const
 Converts to bool.
 
constexpr operator JoystickParam () const
 Converts to JoystickParam.
 
void Close ()
 Close a joystick previously opened with JoystickID.OpenJoystick(). More...
 
void SetVirtualAxis (int axis, Sint16 value)
 Set the state of an axis on an opened virtual joystick. More...
 
void SetVirtualBall (int ball, Sint16 xrel, Sint16 yrel)
 Generate ball motion on an opened virtual joystick. More...
 
void SetVirtualButton (int button, bool down)
 Set the state of a button on an opened virtual joystick. More...
 
void SetVirtualHat (int hat, Uint8 value)
 Set the state of a hat on an opened virtual joystick. More...
 
void SetVirtualTouchpad (int touchpad, int finger, bool down, const FPointRaw &p, float pressure)
 Set touchpad finger state on an opened virtual joystick. More...
 
void SendVirtualSensorData (SensorType type, Uint64 sensor_timestamp, const float *data, int num_values)
 Send a sensor update for an opened virtual joystick. More...
 
PropertiesRef GetProperties ()
 Get the properties associated with a joystick. More...
 
const char * GetName ()
 Get the implementation dependent name of a joystick. More...
 
const char * GetPath ()
 Get the implementation dependent path of a joystick. More...
 
int GetPlayerIndex ()
 Get the player index of an opened joystick. More...
 
void SetPlayerIndex (int player_index)
 Set the player index of an opened joystick. More...
 
GUID GetGUID ()
 Get the implementation-dependent GUID for the joystick. More...
 
Uint16 GetVendor ()
 Get the USB vendor ID of an opened joystick, if available. More...
 
Uint16 GetProduct ()
 Get the USB product ID of an opened joystick, if available. More...
 
Uint16 GetProductVersion ()
 Get the product version of an opened joystick, if available. More...
 
Uint16 GetFirmwareVersion ()
 Get the firmware version of an opened joystick, if available. More...
 
const char * GetSerial ()
 Get the serial number of an opened joystick, if available. More...
 
JoystickType GetType ()
 Get the type of an opened joystick. More...
 
bool Connected ()
 Get the status of a specified joystick. More...
 
JoystickID GetID ()
 Get the instance ID of an opened joystick. More...
 
int GetNumAxes ()
 Get the number of general axis controls on a joystick. More...
 
int GetNumBalls ()
 Get the number of trackballs on a joystick. More...
 
int GetNumHats ()
 Get the number of POV hats on a joystick. More...
 
int GetNumButtons ()
 Get the number of buttons on a joystick. More...
 
Sint16 GetAxis (int axis)
 Get the current state of an axis control on a joystick. More...
 
bool GetAxisInitialState (int axis, Sint16 *state)
 Get the initial state of an axis control on a joystick. More...
 
void GetBall (int ball, int *dx, int *dy)
 Get the ball axis change since the last poll. More...
 
Uint8 GetHat (int hat)
 Get the current state of a POV hat on a joystick. More...
 
bool GetButton (int button)
 Get the current state of a button on a joystick. More...
 
bool Rumble (Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
 Start a rumble effect. More...
 
void RumbleTriggers (Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)
 Start a rumble effect in the joystick's triggers. More...
 
void SetLED (Uint8 red, Uint8 green, Uint8 blue)
 Update a joystick's LED color. More...
 
void SendEffect (const void *data, int size)
 Send a joystick specific effect packet. More...
 
JoystickConnectionState GetConnectionState ()
 Get the connection state of a joystick. More...
 
PowerState GetPowerInfo (int *percent)
 Get the battery state of a joystick. More...
 

Constructor & Destructor Documentation

◆ JoystickRef()

SDL::JoystickRef::JoystickRef ( JoystickParam  resource)
inline
Parameters
resourcea JoystickRaw or Joystick.

This does not takes ownership!


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