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

Locking for atomic access to the joystick API. More...

Public Member Functions

 JoystickApiLock ()
 Locking for atomic access to the joystick API. More...
 
 JoystickApiLock (const JoystickApiLock &other)=delete
 Copy constructor.
 
constexpr JoystickApiLock (JoystickApiLock &&other) noexcept
 Move constructor.
 
 ~JoystickApiLock ()
 Unlocking for atomic access to the joystick API. More...
 
JoystickApiLockoperator= (const JoystickApiLock &other)=delete
 
JoystickApiLockoperator= (JoystickApiLock &&other) noexcept
 Assignment operator.
 
constexpr operator bool () const
 True if not locked.
 
void reset ()
 Unlocking for atomic access to the joystick API. More...
 
void release ()
 Releases the lock without unlocking.
 

Detailed Description

The SDL joystick functions are thread-safe, however you can lock the joysticks while processing to guarantee that the joystick list won't change and joystick and gamepad events will not be delivered.

Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

Constructor & Destructor Documentation

◆ ~JoystickApiLock()

SDL::JoystickApiLock::~JoystickApiLock ( )
inline
Thread safety:
This should be called from the same thread that called LockJoysticks().
Since
This function is available since SDL 3.2.0.

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