SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL3pp_haptic.h
1#ifndef SDL3PP_HAPTIC_H_
2#define SDL3PP_HAPTIC_H_
3
4#include <SDL3/SDL_haptic.h>
5#include "SDL3pp_error.h"
6#include "SDL3pp_joystick.h"
7#include "SDL3pp_stdinc.h"
8
9namespace SDL {
10
106
107// Forward decl
108struct HapticBase;
109
110// Forward decl
111struct Haptic;
112
114using HapticRaw = SDL_Haptic*;
115
122
127
135using HapticEffectID = int;
136
139
149constexpr HapticEffectType HAPTIC_CONSTANT = SDL_HAPTIC_CONSTANT;
150
160constexpr HapticEffectType HAPTIC_SINE = SDL_HAPTIC_SINE;
161
171constexpr HapticEffectType HAPTIC_SQUARE = SDL_HAPTIC_SQUARE;
172
182constexpr HapticEffectType HAPTIC_TRIANGLE = SDL_HAPTIC_TRIANGLE;
183
193constexpr HapticEffectType HAPTIC_SAWTOOTHUP = SDL_HAPTIC_SAWTOOTHUP;
194
204constexpr HapticEffectType HAPTIC_SAWTOOTHDOWN = SDL_HAPTIC_SAWTOOTHDOWN;
205
215constexpr HapticEffectType HAPTIC_RAMP = SDL_HAPTIC_RAMP;
216
227constexpr HapticEffectType HAPTIC_SPRING = SDL_HAPTIC_SPRING;
228
239constexpr HapticEffectType HAPTIC_DAMPER = SDL_HAPTIC_DAMPER;
240
251constexpr HapticEffectType HAPTIC_INERTIA = SDL_HAPTIC_INERTIA;
252
263constexpr HapticEffectType HAPTIC_FRICTION = SDL_HAPTIC_FRICTION;
264
274constexpr HapticEffectType HAPTIC_LEFTRIGHT = SDL_HAPTIC_LEFTRIGHT;
275
281constexpr HapticEffectType HAPTIC_RESERVED1 = SDL_HAPTIC_RESERVED1;
282
288constexpr HapticEffectType HAPTIC_RESERVED2 = SDL_HAPTIC_RESERVED2;
289
295constexpr HapticEffectType HAPTIC_RESERVED3 = SDL_HAPTIC_RESERVED3;
296
304constexpr HapticEffectType HAPTIC_CUSTOM = SDL_HAPTIC_CUSTOM;
305
315constexpr HapticEffectType HAPTIC_GAIN = SDL_HAPTIC_GAIN;
316
326constexpr HapticEffectType HAPTIC_AUTOCENTER = SDL_HAPTIC_AUTOCENTER;
327
337constexpr HapticEffectType HAPTIC_STATUS = SDL_HAPTIC_STATUS;
338
349constexpr HapticEffectType HAPTIC_PAUSE = SDL_HAPTIC_PAUSE;
350
352
357
360
368constexpr HapticDirectionType HAPTIC_POLAR = SDL_HAPTIC_POLAR;
369
377constexpr HapticDirectionType HAPTIC_CARTESIAN = SDL_HAPTIC_CARTESIAN;
378
386constexpr HapticDirectionType HAPTIC_SPHERICAL = SDL_HAPTIC_SPHERICAL;
387
398constexpr HapticDirectionType HAPTIC_STEERING_AXIS = SDL_HAPTIC_STEERING_AXIS;
399
401
409constexpr Uint32 HAPTIC_INFINITY = SDL_HAPTIC_INFINITY;
410
515using HapticDirection = SDL_HapticDirection;
516
530using HapticConstant = SDL_HapticConstant;
531
594using HapticPeriodic = SDL_HapticPeriodic;
595
622using HapticCondition = SDL_HapticCondition;
623
639using HapticRamp = SDL_HapticRamp;
640
655using HapticLeftRight = SDL_HapticLeftRight;
656
674using HapticCustom = SDL_HapticCustom;
675
748using HapticEffect = SDL_HapticEffect;
749
760using HapticID = SDL_HapticID;
761
767struct HapticBase : ResourceBaseT<HapticRaw>
768{
770
778 void Close();
779
788 HapticID GetID();
789
801 const char* GetName();
802
818 int GetMaxEffects();
819
834
848
860 int GetNumAxes();
861
873 bool EffectSupported(const HapticEffect& effect);
874
890
909 void UpdateEffect(HapticEffectID effect, const HapticEffect& data);
910
930 void RunEffect(HapticEffectID effect, Uint32 iterations);
931
943 void StopEffect(HapticEffectID effect);
944
957 void DestroyEffect(HapticEffectID effect);
958
972 bool GetEffectStatus(HapticEffectID effect);
973
992 void SetGain(int gain);
993
1009 void SetAutocenter(int autocenter);
1010
1026 void Pause();
1027
1039 void Resume();
1040
1051 void StopEffects();
1052
1062 bool RumbleSupported();
1063
1075 void InitRumble();
1076
1089 void PlayRumble(float strength, Uint32 length);
1090
1100 void StopRumble();
1101};
1102
1115{
1116 using HapticBase::HapticBase;
1117
1125 constexpr explicit Haptic(HapticRaw resource) noexcept
1126 : HapticBase(resource)
1127 {
1128 }
1129
1131 constexpr Haptic(Haptic&& other) noexcept
1132 : Haptic(other.release())
1133 {
1134 }
1135
1159 Haptic(HapticID instance_id);
1160
1181 Haptic(JoystickRef joystick);
1182
1194 static Haptic OpenFromMouse();
1195
1197 ~Haptic() { SDL_CloseHaptic(get()); }
1198
1200 constexpr Haptic& operator=(Haptic&& other) noexcept
1201 {
1202 swap(*this, other);
1203 return *this;
1204 }
1205};
1206
1218{
1219 int count;
1220 auto data = SDL_GetHaptics(&count);
1221 return OwnArray<HapticID>{data};
1222}
1223
1238inline const char* GetHapticNameForID(HapticID instance_id)
1239{
1240 return SDL_GetHapticNameForID(instance_id);
1241}
1242
1266inline Haptic OpenHaptic(HapticID instance_id) { return Haptic(instance_id); }
1267
1268inline Haptic::Haptic(HapticID instance_id)
1269 : Haptic(SDL_OpenHaptic(instance_id))
1270{
1271}
1272
1274 : Haptic(CheckError(SDL_OpenHapticFromJoystick(joystick)))
1275{
1276}
1277
1288{
1289 return {CheckError(SDL_GetHapticFromID(instance_id))};
1290}
1291
1302{
1303 return CheckError(SDL_GetHapticID(haptic));
1304}
1305
1307
1319inline const char* GetHapticName(HapticRef haptic)
1320{
1321 return SDL_GetHapticName(haptic);
1322}
1323
1324inline const char* HapticBase::GetName() { return SDL::GetHapticName(get()); }
1325
1335inline bool IsMouseHaptic() { return SDL_IsMouseHaptic(); }
1336
1349{
1350 return Haptic(SDL_OpenHapticFromMouse());
1351}
1352
1354
1365inline bool IsJoystickHaptic(JoystickRef joystick)
1366{
1367 return SDL_IsJoystickHaptic(joystick);
1368}
1369
1391{
1392 return Haptic(joystick);
1393}
1394
1404inline void CloseHaptic(HapticRaw haptic) { SDL_CloseHaptic(haptic); }
1405
1407
1425{
1426 return SDL_GetMaxHapticEffects(haptic);
1427}
1428
1430{
1431 return SDL::GetMaxHapticEffects(get());
1432}
1433
1449{
1450 return SDL_GetMaxHapticEffectsPlaying(haptic);
1451}
1452
1457
1472{
1473 return CheckError(SDL_GetHapticFeatures(haptic));
1474}
1475
1477{
1478 return SDL::GetHapticFeatures(get());
1479}
1480
1493inline int GetNumHapticAxes(HapticRef haptic)
1494{
1495 return CheckError(SDL_GetNumHapticAxes(haptic));
1496}
1497
1499
1512inline bool HapticEffectSupported(HapticRef haptic, const HapticEffect& effect)
1513{
1514 return SDL_HapticEffectSupported(haptic, &effect);
1515}
1516
1518{
1519 return SDL::HapticEffectSupported(get(), effect);
1520}
1521
1538 const HapticEffect& effect)
1539{
1540 return CheckError(SDL_CreateHapticEffect(haptic, &effect));
1541}
1542
1544{
1545 return SDL::CreateHapticEffect(get(), effect);
1546}
1547
1568 HapticEffectID effect,
1569 const HapticEffect& data)
1570{
1571 CheckError(SDL_UpdateHapticEffect(haptic, effect, &data));
1572}
1573
1575 const HapticEffect& data)
1576{
1577 SDL::UpdateHapticEffect(get(), effect, data);
1578}
1579
1600inline void RunHapticEffect(HapticRef haptic,
1601 HapticEffectID effect,
1602 Uint32 iterations)
1603{
1604 CheckError(SDL_RunHapticEffect(haptic, effect, iterations));
1605}
1606
1607inline void HapticBase::RunEffect(HapticEffectID effect, Uint32 iterations)
1608{
1609 SDL::RunHapticEffect(get(), effect, iterations);
1610}
1611
1624inline void StopHapticEffect(HapticRef haptic, HapticEffectID effect)
1625{
1626 CheckError(SDL_StopHapticEffect(haptic, effect));
1627}
1628
1630{
1631 SDL::StopHapticEffect(get(), effect);
1632}
1633
1648{
1649 SDL_DestroyHapticEffect(haptic, effect);
1650}
1651
1653{
1654 SDL::DestroyHapticEffect(get(), effect);
1655}
1656
1672{
1673 return SDL_GetHapticEffectStatus(haptic, effect);
1674}
1675
1677{
1678 return SDL::GetHapticEffectStatus(get(), effect);
1679}
1680
1699inline void SetHapticGain(HapticRef haptic, int gain)
1700{
1701 CheckError(SDL_SetHapticGain(haptic, gain));
1702}
1703
1704inline void HapticBase::SetGain(int gain) { SDL::SetHapticGain(get(), gain); }
1705
1722inline void SetHapticAutocenter(HapticRef haptic, int autocenter)
1723{
1724 CheckError(SDL_SetHapticAutocenter(haptic, autocenter));
1725}
1726
1727inline void HapticBase::SetAutocenter(int autocenter)
1728{
1729 SDL::SetHapticAutocenter(get(), autocenter);
1730}
1731
1748inline void PauseHaptic(HapticRef haptic)
1749{
1750 CheckError(SDL_PauseHaptic(haptic));
1751}
1752
1754
1767inline void ResumeHaptic(HapticRef haptic)
1768{
1769 CheckError(SDL_ResumeHaptic(haptic));
1770}
1771
1773
1785inline void StopHapticEffects(HapticRef haptic)
1786{
1787 CheckError(SDL_StopHapticEffects(haptic));
1788}
1789
1791
1803{
1804 return SDL_HapticRumbleSupported(haptic);
1805}
1806
1808{
1810}
1811
1824inline void InitHapticRumble(HapticRef haptic)
1825{
1826 CheckError(SDL_InitHapticRumble(haptic));
1827}
1828
1830
1844inline void PlayHapticRumble(HapticRef haptic, float strength, Uint32 length)
1845{
1846 CheckError(SDL_PlayHapticRumble(haptic, strength, length));
1847}
1848
1849inline void HapticBase::PlayRumble(float strength, Uint32 length)
1850{
1851 SDL::PlayHapticRumble(get(), strength, length);
1852}
1853
1864inline void StopHapticRumble(HapticRef haptic)
1865{
1866 CheckError(SDL_StopHapticRumble(haptic));
1867}
1868
1870
1872
1873} // namespace SDL
1874
1875#endif /* SDL3PP_HAPTIC_H_ */
Base class for SDL memory allocated array wrap.
Definition SDL3pp_ownPtr.h:44
constexpr RawPointer release() noexcept
Definition SDL3pp_resource.h:57
friend constexpr void swap(ResourceBaseT &lhs, ResourceBaseT &rhs) noexcept
Definition SDL3pp_resource.h:65
constexpr RawPointer get() const noexcept
Definition SDL3pp_resource.h:54
constexpr ResourceBaseT()=default
Default constructor, creates null/invalid resource.
constexpr void CheckError(bool result)
Check and throw if returned value from SDL is an error.
Definition SDL3pp_error.h:199
SDL_HapticDirection HapticDirection
Structure that represents a haptic direction.
Definition SDL3pp_haptic.h:515
SDL_Haptic * HapticRaw
Alias to raw representation for Haptic.
Definition SDL3pp_haptic.h:114
void RunEffect(HapticEffectID effect, Uint32 iterations)
Run the haptic effect on its associated haptic device.
Definition SDL3pp_haptic.h:1607
constexpr HapticEffectType HAPTIC_FRICTION
Friction effect supported - uses axes movement.
Definition SDL3pp_haptic.h:263
void SetHapticAutocenter(HapticRef haptic, int autocenter)
Set the global autocenter of the device.
Definition SDL3pp_haptic.h:1722
SDL_HapticConstant HapticConstant
A structure containing a template for a Constant effect.
Definition SDL3pp_haptic.h:530
Haptic OpenHaptic(HapticID instance_id)
Open a haptic device for use.
Definition SDL3pp_haptic.h:1266
bool HapticRumbleSupported(HapticRef haptic)
Check whether rumble is supported on a haptic device.
Definition SDL3pp_haptic.h:1802
constexpr HapticEffectType HAPTIC_GAIN
Device can set global gain.
Definition SDL3pp_haptic.h:315
void InitHapticRumble(HapticRef haptic)
Initialize a haptic device for simple rumble playback.
Definition SDL3pp_haptic.h:1824
bool GetEffectStatus(HapticEffectID effect)
Get the status of the current effect on the specified haptic device.
Definition SDL3pp_haptic.h:1676
SDL_HapticLeftRight HapticLeftRight
A structure containing a template for a Left/Right effect.
Definition SDL3pp_haptic.h:655
constexpr HapticEffectType HAPTIC_SINE
Sine wave effect supported.
Definition SDL3pp_haptic.h:160
void StopHapticEffects(HapticRef haptic)
Stop all the currently playing effects on a haptic device.
Definition SDL3pp_haptic.h:1785
int GetMaxHapticEffectsPlaying(HapticRef haptic)
Get the number of effects a haptic device can play at the same time.
Definition SDL3pp_haptic.h:1448
constexpr Uint32 HAPTIC_INFINITY
Used to play a device an infinite number of times.
Definition SDL3pp_haptic.h:409
void Resume()
Resume a haptic device.
Definition SDL3pp_haptic.h:1772
constexpr HapticEffectType HAPTIC_DAMPER
Damper effect supported - uses axes velocity.
Definition SDL3pp_haptic.h:239
void DestroyHapticEffect(HapticRef haptic, HapticEffectID effect)
Destroy a haptic effect on the device.
Definition SDL3pp_haptic.h:1647
int GetNumHapticAxes(HapticRef haptic)
Get the number of haptic axes the device has.
Definition SDL3pp_haptic.h:1493
void StopHapticRumble(HapticRef haptic)
Stop the simple rumble on a haptic device.
Definition SDL3pp_haptic.h:1864
void RunHapticEffect(HapticRef haptic, HapticEffectID effect, Uint32 iterations)
Run the haptic effect on its associated haptic device.
Definition SDL3pp_haptic.h:1600
SDL_HapticID HapticID
This is a unique ID for a haptic device for the time it is connected to the system,...
Definition SDL3pp_haptic.h:760
Uint8 HapticDirectionType
Type of coordinates used for haptic direction.
Definition SDL3pp_haptic.h:359
void ResumeHaptic(HapticRef haptic)
Resume a haptic device.
Definition SDL3pp_haptic.h:1767
int GetMaxEffects()
Get the number of effects a haptic device can store.
Definition SDL3pp_haptic.h:1429
constexpr HapticEffectType HAPTIC_RESERVED3
Reserved for future use.
Definition SDL3pp_haptic.h:295
int HapticEffectID
ID for haptic effects.
Definition SDL3pp_haptic.h:135
HapticID GetHapticID(HapticRef haptic)
Get the instance ID of an opened haptic device.
Definition SDL3pp_haptic.h:1301
constexpr HapticEffectType HAPTIC_INERTIA
Inertia effect supported - uses axes acceleration.
Definition SDL3pp_haptic.h:251
ResourceRefT< HapticBase > HapticRef
Reference for Haptic.
Definition SDL3pp_haptic.h:121
bool GetHapticEffectStatus(HapticRef haptic, HapticEffectID effect)
Get the status of the current effect on the specified haptic device.
Definition SDL3pp_haptic.h:1671
constexpr HapticEffectType HAPTIC_SPRING
Spring effect supported - uses axes position.
Definition SDL3pp_haptic.h:227
constexpr HapticEffectType HAPTIC_LEFTRIGHT
Left/Right effect supported.
Definition SDL3pp_haptic.h:274
const char * GetHapticNameForID(HapticID instance_id)
Get the implementation dependent name of a haptic device.
Definition SDL3pp_haptic.h:1238
SDL_HapticCondition HapticCondition
A structure containing a template for a Condition effect.
Definition SDL3pp_haptic.h:622
HapticEffectID CreateHapticEffect(HapticRef haptic, const HapticEffect &effect)
Create a new haptic effect on a specified device.
Definition SDL3pp_haptic.h:1537
void StopEffect(HapticEffectID effect)
Stop the haptic effect on its associated haptic device.
Definition SDL3pp_haptic.h:1629
void SetAutocenter(int autocenter)
Set the global autocenter of the device.
Definition SDL3pp_haptic.h:1727
constexpr HapticEffectType HAPTIC_CUSTOM
Custom effect is supported.
Definition SDL3pp_haptic.h:304
void StopRumble()
Stop the simple rumble on a haptic device.
Definition SDL3pp_haptic.h:1869
Haptic OpenHapticFromMouse()
Try to open a haptic device from the current mouse.
Definition SDL3pp_haptic.h:1348
Uint32 HapticEffectType
Type of haptic effect.
Definition SDL3pp_haptic.h:138
constexpr HapticDirectionType HAPTIC_STEERING_AXIS
Use this value to play an effect on the steering wheel axis.
Definition SDL3pp_haptic.h:398
bool IsMouseHaptic()
Query whether or not the current mouse has haptic capabilities.
Definition SDL3pp_haptic.h:1335
void UpdateEffect(HapticEffectID effect, const HapticEffect &data)
Update the properties of an effect.
Definition SDL3pp_haptic.h:1574
bool HapticEffectSupported(HapticRef haptic, const HapticEffect &effect)
Check to see if an effect is supported by a haptic device.
Definition SDL3pp_haptic.h:1512
int GetMaxEffectsPlaying()
Get the number of effects a haptic device can play at the same time.
Definition SDL3pp_haptic.h:1453
Haptic OpenHapticFromJoystick(JoystickRef joystick)
Open a haptic device for use from a joystick device.
Definition SDL3pp_haptic.h:1390
void Close()
Close a haptic device previously opened with OpenHaptic().
Definition SDL3pp_haptic.h:1406
SDL_HapticRamp HapticRamp
A structure containing a template for a Ramp effect.
Definition SDL3pp_haptic.h:639
constexpr HapticEffectType HAPTIC_PAUSE
Device can be paused.
Definition SDL3pp_haptic.h:349
constexpr HapticEffectType HAPTIC_SQUARE
Square wave effect supported.
Definition SDL3pp_haptic.h:171
void PlayHapticRumble(HapticRef haptic, float strength, Uint32 length)
Run a simple rumble effect on a haptic device.
Definition SDL3pp_haptic.h:1844
int GetMaxHapticEffects(HapticRef haptic)
Get the number of effects a haptic device can store.
Definition SDL3pp_haptic.h:1424
constexpr HapticEffectType HAPTIC_TRIANGLE
Triangle wave effect supported.
Definition SDL3pp_haptic.h:182
void PauseHaptic(HapticRef haptic)
Pause a haptic device.
Definition SDL3pp_haptic.h:1748
void DestroyEffect(HapticEffectID effect)
Destroy a haptic effect on the device.
Definition SDL3pp_haptic.h:1652
void SetHapticGain(HapticRef haptic, int gain)
Set the global gain of the specified haptic device.
Definition SDL3pp_haptic.h:1699
const char * GetName()
Get the implementation dependent name of a haptic device.
Definition SDL3pp_haptic.h:1324
void UpdateHapticEffect(HapticRef haptic, HapticEffectID effect, const HapticEffect &data)
Update the properties of an effect.
Definition SDL3pp_haptic.h:1567
constexpr HapticEffectType HAPTIC_RESERVED1
Reserved for future use.
Definition SDL3pp_haptic.h:281
void CloseHaptic(HapticRaw haptic)
Close a haptic device previously opened with OpenHaptic().
Definition SDL3pp_haptic.h:1404
constexpr HapticDirectionType HAPTIC_SPHERICAL
Uses spherical coordinates for the direction.
Definition SDL3pp_haptic.h:386
HapticEffectID CreateEffect(const HapticEffect &effect)
Create a new haptic effect on a specified device.
Definition SDL3pp_haptic.h:1543
HapticID GetID()
Get the instance ID of an opened haptic device.
Definition SDL3pp_haptic.h:1306
constexpr HapticEffectType HAPTIC_AUTOCENTER
Device can set autocenter.
Definition SDL3pp_haptic.h:326
bool RumbleSupported()
Check whether rumble is supported on a haptic device.
Definition SDL3pp_haptic.h:1807
static Haptic OpenFromMouse()
Try to open a haptic device from the current mouse.
Definition SDL3pp_haptic.h:1353
constexpr HapticEffectType HAPTIC_SAWTOOTHDOWN
Sawtoothdown wave effect supported.
Definition SDL3pp_haptic.h:204
constexpr HapticDirectionType HAPTIC_CARTESIAN
Uses cartesian coordinates for the direction.
Definition SDL3pp_haptic.h:377
void InitRumble()
Initialize a haptic device for simple rumble playback.
Definition SDL3pp_haptic.h:1829
Uint32 GetHapticFeatures(HapticRef haptic)
Get the haptic device's supported features in bitwise manner.
Definition SDL3pp_haptic.h:1471
SDL_HapticEffect HapticEffect
The generic template for any haptic effect.
Definition SDL3pp_haptic.h:748
const char * GetHapticName(HapticRef haptic)
Get the implementation dependent name of a haptic device.
Definition SDL3pp_haptic.h:1319
constexpr HapticDirectionType HAPTIC_POLAR
Uses polar coordinates for the direction.
Definition SDL3pp_haptic.h:368
bool IsJoystickHaptic(JoystickRef joystick)
Query if a joystick has haptic features.
Definition SDL3pp_haptic.h:1365
constexpr HapticEffectType HAPTIC_CONSTANT
Constant effect supported.
Definition SDL3pp_haptic.h:149
SDL_HapticCustom HapticCustom
A structure containing a template for the HAPTIC_CUSTOM effect.
Definition SDL3pp_haptic.h:674
constexpr HapticEffectType HAPTIC_RESERVED2
Reserved for future use.
Definition SDL3pp_haptic.h:288
HapticRef GetHapticFromID(HapticID instance_id)
Get the Haptic associated with an instance ID, if it has been opened.
Definition SDL3pp_haptic.h:1287
constexpr HapticEffectType HAPTIC_STATUS
Device can be queried for effect status.
Definition SDL3pp_haptic.h:337
void PlayRumble(float strength, Uint32 length)
Run a simple rumble effect on a haptic device.
Definition SDL3pp_haptic.h:1849
int GetNumAxes()
Get the number of haptic axes the device has.
Definition SDL3pp_haptic.h:1498
void Pause()
Pause a haptic device.
Definition SDL3pp_haptic.h:1753
Uint32 GetFeatures()
Get the haptic device's supported features in bitwise manner.
Definition SDL3pp_haptic.h:1476
OwnArray< HapticID > GetHaptics()
Get a list of currently connected haptic devices.
Definition SDL3pp_haptic.h:1217
constexpr HapticEffectType HAPTIC_SAWTOOTHUP
Sawtoothup wave effect supported.
Definition SDL3pp_haptic.h:193
void StopHapticEffect(HapticRef haptic, HapticEffectID effect)
Stop the haptic effect on its associated haptic device.
Definition SDL3pp_haptic.h:1624
SDL_HapticPeriodic HapticPeriodic
A structure containing a template for a Periodic effect.
Definition SDL3pp_haptic.h:594
void StopEffects()
Stop all the currently playing effects on a haptic device.
Definition SDL3pp_haptic.h:1790
bool EffectSupported(const HapticEffect &effect)
Check to see if an effect is supported by a haptic device.
Definition SDL3pp_haptic.h:1517
void SetGain(int gain)
Set the global gain of the specified haptic device.
Definition SDL3pp_haptic.h:1704
constexpr HapticEffectType HAPTIC_RAMP
Ramp effect supported.
Definition SDL3pp_haptic.h:215
ResourceRefT< JoystickBase > JoystickRef
Reference for Joystick.
Definition SDL3pp_joystick.h:71
::Uint32 Uint32
An unsigned 32-bit integer type.
Definition SDL3pp_stdinc.h:296
::Uint8 Uint8
An unsigned 8-bit integer type.
Definition SDL3pp_stdinc.h:244
Main include header for the SDL3pp library.
Base class to Haptic.
Definition SDL3pp_haptic.h:768
constexpr ResourceBaseT()=default
Default constructor, creates null/invalid resource.
The haptic structure used to identify an SDL haptic.
Definition SDL3pp_haptic.h:1115
constexpr Haptic(HapticRaw resource) noexcept
Constructs from raw Haptic.
Definition SDL3pp_haptic.h:1125
constexpr Haptic & operator=(Haptic &&other) noexcept
Assignment operator.
Definition SDL3pp_haptic.h:1200
constexpr Haptic(Haptic &&other) noexcept
Move constructor.
Definition SDL3pp_haptic.h:1131
~Haptic()
Destructor.
Definition SDL3pp_haptic.h:1197
A non-owning reference wrapper for a given resource.
Definition SDL3pp_resource.h:93