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

The haptic structure used to identify an SDL haptic. More...

Inheritance diagram for SDL::Haptic:
[legend]

Public Member Functions

constexpr Haptic (HapticRaw resource) noexcept
 Constructs from raw Haptic.
constexpr Haptic (const Haptic &other)=delete
 Copy constructor.
constexpr Haptic (Haptic &&other) noexcept
 Move constructor.
constexpr Haptic (const HapticRef &other)=delete
constexpr Haptic (HapticRef &&other)=delete
 Haptic (HapticID instance_id)
 Open a haptic device for use.
 Haptic (JoystickRef joystick)
 Open a haptic device for use from a joystick device.
 ~Haptic ()
 Destructor.
constexpr Hapticoperator= (Haptic &&other) noexcept
 Assignment operator.
Hapticoperator= (const Haptic &other)=delete
 Assignment operator.
void Close ()
 Close a haptic device previously opened with OpenHaptic().
HapticID GetID ()
 Get the instance ID of an opened haptic device.
const char * GetName ()
 Get the implementation dependent name of a haptic device.
int GetMaxEffects ()
 Get the number of effects a haptic device can store.
int GetMaxEffectsPlaying ()
 Get the number of effects a haptic device can play at the same time.
Uint32 GetFeatures ()
 Get the haptic device's supported features in bitwise manner.
int GetNumAxes ()
 Get the number of haptic axes the device has.
bool EffectSupported (const HapticEffect &effect)
 Check to see if an effect is supported by a haptic device.
HapticEffectID CreateEffect (const HapticEffect &effect)
 Create a new haptic effect on a specified device.
void UpdateEffect (HapticEffectID effect, const HapticEffect &data)
 Update the properties of an effect.
void RunEffect (HapticEffectID effect, Uint32 iterations)
 Run the haptic effect on its associated haptic device.
void StopEffect (HapticEffectID effect)
 Stop the haptic effect on its associated haptic device.
void DestroyEffect (HapticEffectID effect)
 Destroy a haptic effect on the device.
bool GetEffectStatus (HapticEffectID effect)
 Get the status of the current effect on the specified haptic device.
void SetGain (int gain)
 Set the global gain of the specified haptic device.
void SetAutocenter (int autocenter)
 Set the global autocenter of the device.
void Pause ()
 Pause a haptic device.
void Resume ()
 Resume a haptic device.
void StopEffects ()
 Stop all the currently playing effects on a haptic device.
bool RumbleSupported ()
 Check whether rumble is supported on a haptic device.
void InitRumble ()
 Initialize a haptic device for simple rumble playback.
void PlayRumble (float strength, Uint32 length)
 Run a simple rumble effect on a haptic device.
void StopRumble ()
 Stop the simple rumble on a haptic device.
constexpr ResourceBase (RawPointer resource)
 Constructs from resource pointer.
constexpr ResourceBase (std::nullptr_t=nullptr)
 Constructs null/invalid.
Public Member Functions inherited from SDL::ResourceBase< HapticRaw >
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.

Static Public Member Functions

static Haptic OpenFromMouse ()
 Try to open a haptic device from the current mouse.

Additional Inherited Members

Public Types inherited from SDL::ResourceBase< HapticRaw >
using RawPointer
 The underlying raw pointer type.
using RawConstPointer
 The underlying const raw pointer type.

Detailed Description

The haptic structure used to identify an SDL haptic.

Since
This struct is available since SDL 3.2.0.
See also
OpenHaptic
OpenHapticFromJoystick
Haptic.Close
Category:
Resource

Constructor & Destructor Documentation

◆ Haptic()

SDL::Haptic::Haptic ( HapticRaw resource)
inlineexplicitconstexprnoexcept

Constructs from raw Haptic.

Parameters
resourcea HapticRaw to be wrapped.

This assumes the ownership, call release() if you need to take back.


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