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 Haptic;
109
111using HapticRaw = SDL_Haptic*;
112
119
124
132using HapticEffectID = int;
133
136
146constexpr HapticEffectType HAPTIC_CONSTANT = SDL_HAPTIC_CONSTANT;
147
157constexpr HapticEffectType HAPTIC_SINE = SDL_HAPTIC_SINE;
158
168constexpr HapticEffectType HAPTIC_SQUARE = SDL_HAPTIC_SQUARE;
169
179constexpr HapticEffectType HAPTIC_TRIANGLE = SDL_HAPTIC_TRIANGLE;
180
190constexpr HapticEffectType HAPTIC_SAWTOOTHUP = SDL_HAPTIC_SAWTOOTHUP;
191
201constexpr HapticEffectType HAPTIC_SAWTOOTHDOWN = SDL_HAPTIC_SAWTOOTHDOWN;
202
212constexpr HapticEffectType HAPTIC_RAMP = SDL_HAPTIC_RAMP;
213
224constexpr HapticEffectType HAPTIC_SPRING = SDL_HAPTIC_SPRING;
225
236constexpr HapticEffectType HAPTIC_DAMPER = SDL_HAPTIC_DAMPER;
237
248constexpr HapticEffectType HAPTIC_INERTIA = SDL_HAPTIC_INERTIA;
249
260constexpr HapticEffectType HAPTIC_FRICTION = SDL_HAPTIC_FRICTION;
261
271constexpr HapticEffectType HAPTIC_LEFTRIGHT = SDL_HAPTIC_LEFTRIGHT;
272
278constexpr HapticEffectType HAPTIC_RESERVED1 = SDL_HAPTIC_RESERVED1;
279
285constexpr HapticEffectType HAPTIC_RESERVED2 = SDL_HAPTIC_RESERVED2;
286
292constexpr HapticEffectType HAPTIC_RESERVED3 = SDL_HAPTIC_RESERVED3;
293
301constexpr HapticEffectType HAPTIC_CUSTOM = SDL_HAPTIC_CUSTOM;
302
312constexpr HapticEffectType HAPTIC_GAIN = SDL_HAPTIC_GAIN;
313
323constexpr HapticEffectType HAPTIC_AUTOCENTER = SDL_HAPTIC_AUTOCENTER;
324
334constexpr HapticEffectType HAPTIC_STATUS = SDL_HAPTIC_STATUS;
335
346constexpr HapticEffectType HAPTIC_PAUSE = SDL_HAPTIC_PAUSE;
347
349
354
357
365constexpr HapticDirectionType HAPTIC_POLAR = SDL_HAPTIC_POLAR;
366
374constexpr HapticDirectionType HAPTIC_CARTESIAN = SDL_HAPTIC_CARTESIAN;
375
383constexpr HapticDirectionType HAPTIC_SPHERICAL = SDL_HAPTIC_SPHERICAL;
384
395constexpr HapticDirectionType HAPTIC_STEERING_AXIS = SDL_HAPTIC_STEERING_AXIS;
396
398
406constexpr Uint32 HAPTIC_INFINITY = SDL_HAPTIC_INFINITY;
407
512using HapticDirection = SDL_HapticDirection;
513
527using HapticConstant = SDL_HapticConstant;
528
591using HapticPeriodic = SDL_HapticPeriodic;
592
619using HapticCondition = SDL_HapticCondition;
620
636using HapticRamp = SDL_HapticRamp;
637
652using HapticLeftRight = SDL_HapticLeftRight;
653
671using HapticCustom = SDL_HapticCustom;
672
745using HapticEffect = SDL_HapticEffect;
746
757using HapticID = SDL_HapticID;
758
770struct Haptic : ResourceBase<HapticRaw>
771{
773
781 constexpr explicit Haptic(HapticRaw resource) noexcept
782 : ResourceBase(resource)
783 {
784 }
785
787 constexpr Haptic(const Haptic& other) = delete;
788
790 constexpr Haptic(Haptic&& other) noexcept
791 : Haptic(other.release())
792 {
793 }
794
795 constexpr Haptic(const HapticRef& other) = delete;
796
797 constexpr Haptic(HapticRef&& other) = delete;
798
822 Haptic(HapticID instance_id);
823
844 Haptic(JoystickRef joystick);
845
857 static Haptic OpenFromMouse();
858
860 ~Haptic() { SDL_CloseHaptic(get()); }
861
863 constexpr Haptic& operator=(Haptic&& other) noexcept
864 {
865 swap(*this, other);
866 return *this;
867 }
868
870 Haptic& operator=(const Haptic& other) = delete;
871
879 void Close();
880
889 HapticID GetID();
890
902 const char* GetName();
903
919 int GetMaxEffects();
920
935
949
961 int GetNumAxes();
962
974 bool EffectSupported(const HapticEffect& effect);
975
991
1010 void UpdateEffect(HapticEffectID effect, const HapticEffect& data);
1011
1031 void RunEffect(HapticEffectID effect, Uint32 iterations);
1032
1044 void StopEffect(HapticEffectID effect);
1045
1058 void DestroyEffect(HapticEffectID effect);
1059
1073 bool GetEffectStatus(HapticEffectID effect);
1074
1093 void SetGain(int gain);
1094
1110 void SetAutocenter(int autocenter);
1111
1127 void Pause();
1128
1140 void Resume();
1141
1152 void StopEffects();
1153
1163 bool RumbleSupported();
1164
1176 void InitRumble();
1177
1190 void PlayRumble(float strength, Uint32 length);
1191
1201 void StopRumble();
1202};
1203
1215{
1216 int count;
1217 auto data = SDL_GetHaptics(&count);
1218 return OwnArray<HapticID>{data};
1219}
1220
1235inline const char* GetHapticNameForID(HapticID instance_id)
1236{
1237 return SDL_GetHapticNameForID(instance_id);
1238}
1239
1263inline Haptic OpenHaptic(HapticID instance_id) { return Haptic(instance_id); }
1264
1265inline Haptic::Haptic(HapticID instance_id)
1266 : Haptic(SDL_OpenHaptic(instance_id))
1267{
1268}
1269
1271 : Haptic(CheckError(SDL_OpenHapticFromJoystick(joystick)))
1272{
1273}
1274
1285{
1286 return {CheckError(SDL_GetHapticFromID(instance_id))};
1287}
1288
1299{
1300 return CheckError(SDL_GetHapticID(haptic));
1301}
1302
1304
1316inline const char* GetHapticName(HapticRef haptic)
1317{
1318 return SDL_GetHapticName(haptic);
1319}
1320
1321inline const char* Haptic::GetName() { return SDL::GetHapticName(get()); }
1322
1332inline bool IsMouseHaptic() { return SDL_IsMouseHaptic(); }
1333
1346{
1347 return Haptic(SDL_OpenHapticFromMouse());
1348}
1349
1351
1362inline bool IsJoystickHaptic(JoystickRef joystick)
1363{
1364 return SDL_IsJoystickHaptic(joystick);
1365}
1366
1388{
1389 return Haptic(joystick);
1390}
1391
1401inline void CloseHaptic(HapticRaw haptic) { SDL_CloseHaptic(haptic); }
1402
1403inline void Haptic::Close() { CloseHaptic(release()); }
1404
1422{
1423 return SDL_GetMaxHapticEffects(haptic);
1424}
1425
1427
1443{
1444 return SDL_GetMaxHapticEffectsPlaying(haptic);
1445}
1446
1451
1466{
1467 return CheckError(SDL_GetHapticFeatures(haptic));
1468}
1469
1471
1484inline int GetNumHapticAxes(HapticRef haptic)
1485{
1486 return CheckError(SDL_GetNumHapticAxes(haptic));
1487}
1488
1490
1503inline bool HapticEffectSupported(HapticRef haptic, const HapticEffect& effect)
1504{
1505 return SDL_HapticEffectSupported(haptic, &effect);
1506}
1507
1508inline bool Haptic::EffectSupported(const HapticEffect& effect)
1509{
1510 return SDL::HapticEffectSupported(get(), effect);
1511}
1512
1529 const HapticEffect& effect)
1530{
1531 return CheckError(SDL_CreateHapticEffect(haptic, &effect));
1532}
1533
1535{
1536 return SDL::CreateHapticEffect(get(), effect);
1537}
1538
1559 HapticEffectID effect,
1560 const HapticEffect& data)
1561{
1562 CheckError(SDL_UpdateHapticEffect(haptic, effect, &data));
1563}
1564
1566 const HapticEffect& data)
1567{
1568 SDL::UpdateHapticEffect(get(), effect, data);
1569}
1570
1591inline void RunHapticEffect(HapticRef haptic,
1592 HapticEffectID effect,
1593 Uint32 iterations)
1594{
1595 CheckError(SDL_RunHapticEffect(haptic, effect, iterations));
1596}
1597
1598inline void Haptic::RunEffect(HapticEffectID effect, Uint32 iterations)
1599{
1600 SDL::RunHapticEffect(get(), effect, iterations);
1601}
1602
1615inline void StopHapticEffect(HapticRef haptic, HapticEffectID effect)
1616{
1617 CheckError(SDL_StopHapticEffect(haptic, effect));
1618}
1619
1621{
1622 SDL::StopHapticEffect(get(), effect);
1623}
1624
1639{
1640 SDL_DestroyHapticEffect(haptic, effect);
1641}
1642
1644{
1645 SDL::DestroyHapticEffect(get(), effect);
1646}
1647
1663{
1664 return SDL_GetHapticEffectStatus(haptic, effect);
1665}
1666
1668{
1669 return SDL::GetHapticEffectStatus(get(), effect);
1670}
1671
1690inline void SetHapticGain(HapticRef haptic, int gain)
1691{
1692 CheckError(SDL_SetHapticGain(haptic, gain));
1693}
1694
1695inline void Haptic::SetGain(int gain) { SDL::SetHapticGain(get(), gain); }
1696
1713inline void SetHapticAutocenter(HapticRef haptic, int autocenter)
1714{
1715 CheckError(SDL_SetHapticAutocenter(haptic, autocenter));
1716}
1717
1718inline void Haptic::SetAutocenter(int autocenter)
1719{
1720 SDL::SetHapticAutocenter(get(), autocenter);
1721}
1722
1739inline void PauseHaptic(HapticRef haptic)
1740{
1741 CheckError(SDL_PauseHaptic(haptic));
1742}
1743
1745
1758inline void ResumeHaptic(HapticRef haptic)
1759{
1760 CheckError(SDL_ResumeHaptic(haptic));
1761}
1762
1764
1776inline void StopHapticEffects(HapticRef haptic)
1777{
1778 CheckError(SDL_StopHapticEffects(haptic));
1779}
1780
1782
1794{
1795 return SDL_HapticRumbleSupported(haptic);
1796}
1797
1799{
1801}
1802
1815inline void InitHapticRumble(HapticRef haptic)
1816{
1817 CheckError(SDL_InitHapticRumble(haptic));
1818}
1819
1821
1835inline void PlayHapticRumble(HapticRef haptic, float strength, Uint32 length)
1836{
1837 CheckError(SDL_PlayHapticRumble(haptic, strength, length));
1838}
1839
1840inline void Haptic::PlayRumble(float strength, Uint32 length)
1841{
1842 SDL::PlayHapticRumble(get(), strength, length);
1843}
1844
1855inline void StopHapticRumble(HapticRef haptic)
1856{
1857 CheckError(SDL_StopHapticRumble(haptic));
1858}
1859
1861
1863
1864} // namespace SDL
1865
1866#endif /* SDL3PP_HAPTIC_H_ */
Base class for SDL memory allocated array wrap.
Definition SDL3pp_ownPtr.h:44
constexpr RawPointer get() const noexcept
Definition SDL3pp_resource.h:53
constexpr RawPointer release() noexcept
Definition SDL3pp_resource.h:56
constexpr ResourceBase(RawPointer resource)
Constructs from resource pointer.
Definition SDL3pp_resource.h:29
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:512
SDL_Haptic * HapticRaw
Alias to raw representation for Haptic.
Definition SDL3pp_haptic.h:111
void RunEffect(HapticEffectID effect, Uint32 iterations)
Run the haptic effect on its associated haptic device.
Definition SDL3pp_haptic.h:1598
constexpr HapticEffectType HAPTIC_FRICTION
Friction effect supported - uses axes movement.
Definition SDL3pp_haptic.h:260
void SetHapticAutocenter(HapticRef haptic, int autocenter)
Set the global autocenter of the device.
Definition SDL3pp_haptic.h:1713
SDL_HapticConstant HapticConstant
A structure containing a template for a Constant effect.
Definition SDL3pp_haptic.h:527
Haptic OpenHaptic(HapticID instance_id)
Open a haptic device for use.
Definition SDL3pp_haptic.h:1263
bool HapticRumbleSupported(HapticRef haptic)
Check whether rumble is supported on a haptic device.
Definition SDL3pp_haptic.h:1793
void Pause()
Pause a haptic device.
Definition SDL3pp_haptic.h:1744
constexpr HapticEffectType HAPTIC_GAIN
Device can set global gain.
Definition SDL3pp_haptic.h:312
void InitHapticRumble(HapticRef haptic)
Initialize a haptic device for simple rumble playback.
Definition SDL3pp_haptic.h:1815
ResourceRef< Haptic > HapticRef
Reference for Haptic.
Definition SDL3pp_haptic.h:118
SDL_HapticLeftRight HapticLeftRight
A structure containing a template for a Left/Right effect.
Definition SDL3pp_haptic.h:652
void SetGain(int gain)
Set the global gain of the specified haptic device.
Definition SDL3pp_haptic.h:1695
int GetMaxEffectsPlaying()
Get the number of effects a haptic device can play at the same time.
Definition SDL3pp_haptic.h:1447
constexpr HapticEffectType HAPTIC_SINE
Sine wave effect supported.
Definition SDL3pp_haptic.h:157
void StopHapticEffects(HapticRef haptic)
Stop all the currently playing effects on a haptic device.
Definition SDL3pp_haptic.h:1776
int GetMaxHapticEffectsPlaying(HapticRef haptic)
Get the number of effects a haptic device can play at the same time.
Definition SDL3pp_haptic.h:1442
constexpr Uint32 HAPTIC_INFINITY
Used to play a device an infinite number of times.
Definition SDL3pp_haptic.h:406
constexpr HapticEffectType HAPTIC_DAMPER
Damper effect supported - uses axes velocity.
Definition SDL3pp_haptic.h:236
void DestroyHapticEffect(HapticRef haptic, HapticEffectID effect)
Destroy a haptic effect on the device.
Definition SDL3pp_haptic.h:1638
void StopEffect(HapticEffectID effect)
Stop the haptic effect on its associated haptic device.
Definition SDL3pp_haptic.h:1620
int GetNumHapticAxes(HapticRef haptic)
Get the number of haptic axes the device has.
Definition SDL3pp_haptic.h:1484
void StopHapticRumble(HapticRef haptic)
Stop the simple rumble on a haptic device.
Definition SDL3pp_haptic.h:1855
void RunHapticEffect(HapticRef haptic, HapticEffectID effect, Uint32 iterations)
Run the haptic effect on its associated haptic device.
Definition SDL3pp_haptic.h:1591
HapticEffectID CreateEffect(const HapticEffect &effect)
Create a new haptic effect on a specified device.
Definition SDL3pp_haptic.h:1534
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:757
Uint8 HapticDirectionType
Type of coordinates used for haptic direction.
Definition SDL3pp_haptic.h:356
void Resume()
Resume a haptic device.
Definition SDL3pp_haptic.h:1763
void ResumeHaptic(HapticRef haptic)
Resume a haptic device.
Definition SDL3pp_haptic.h:1758
constexpr HapticEffectType HAPTIC_RESERVED3
Reserved for future use.
Definition SDL3pp_haptic.h:292
int HapticEffectID
ID for haptic effects.
Definition SDL3pp_haptic.h:132
HapticID GetHapticID(HapticRef haptic)
Get the instance ID of an opened haptic device.
Definition SDL3pp_haptic.h:1298
constexpr HapticEffectType HAPTIC_INERTIA
Inertia effect supported - uses axes acceleration.
Definition SDL3pp_haptic.h:248
bool GetHapticEffectStatus(HapticRef haptic, HapticEffectID effect)
Get the status of the current effect on the specified haptic device.
Definition SDL3pp_haptic.h:1662
constexpr HapticEffectType HAPTIC_SPRING
Spring effect supported - uses axes position.
Definition SDL3pp_haptic.h:224
constexpr HapticEffectType HAPTIC_LEFTRIGHT
Left/Right effect supported.
Definition SDL3pp_haptic.h:271
const char * GetHapticNameForID(HapticID instance_id)
Get the implementation dependent name of a haptic device.
Definition SDL3pp_haptic.h:1235
SDL_HapticCondition HapticCondition
A structure containing a template for a Condition effect.
Definition SDL3pp_haptic.h:619
HapticEffectID CreateHapticEffect(HapticRef haptic, const HapticEffect &effect)
Create a new haptic effect on a specified device.
Definition SDL3pp_haptic.h:1528
constexpr HapticEffectType HAPTIC_CUSTOM
Custom effect is supported.
Definition SDL3pp_haptic.h:301
void InitRumble()
Initialize a haptic device for simple rumble playback.
Definition SDL3pp_haptic.h:1820
void StopRumble()
Stop the simple rumble on a haptic device.
Definition SDL3pp_haptic.h:1860
void SetAutocenter(int autocenter)
Set the global autocenter of the device.
Definition SDL3pp_haptic.h:1718
Haptic OpenHapticFromMouse()
Try to open a haptic device from the current mouse.
Definition SDL3pp_haptic.h:1345
Uint32 HapticEffectType
Type of haptic effect.
Definition SDL3pp_haptic.h:135
constexpr HapticDirectionType HAPTIC_STEERING_AXIS
Use this value to play an effect on the steering wheel axis.
Definition SDL3pp_haptic.h:395
bool IsMouseHaptic()
Query whether or not the current mouse has haptic capabilities.
Definition SDL3pp_haptic.h:1332
bool GetEffectStatus(HapticEffectID effect)
Get the status of the current effect on the specified haptic device.
Definition SDL3pp_haptic.h:1667
void UpdateEffect(HapticEffectID effect, const HapticEffect &data)
Update the properties of an effect.
Definition SDL3pp_haptic.h:1565
int GetNumAxes()
Get the number of haptic axes the device has.
Definition SDL3pp_haptic.h:1489
bool HapticEffectSupported(HapticRef haptic, const HapticEffect &effect)
Check to see if an effect is supported by a haptic device.
Definition SDL3pp_haptic.h:1503
void PlayRumble(float strength, Uint32 length)
Run a simple rumble effect on a haptic device.
Definition SDL3pp_haptic.h:1840
bool RumbleSupported()
Check whether rumble is supported on a haptic device.
Definition SDL3pp_haptic.h:1798
Haptic OpenHapticFromJoystick(JoystickRef joystick)
Open a haptic device for use from a joystick device.
Definition SDL3pp_haptic.h:1387
SDL_HapticRamp HapticRamp
A structure containing a template for a Ramp effect.
Definition SDL3pp_haptic.h:636
constexpr HapticEffectType HAPTIC_PAUSE
Device can be paused.
Definition SDL3pp_haptic.h:346
constexpr HapticEffectType HAPTIC_SQUARE
Square wave effect supported.
Definition SDL3pp_haptic.h:168
void PlayHapticRumble(HapticRef haptic, float strength, Uint32 length)
Run a simple rumble effect on a haptic device.
Definition SDL3pp_haptic.h:1835
int GetMaxHapticEffects(HapticRef haptic)
Get the number of effects a haptic device can store.
Definition SDL3pp_haptic.h:1421
constexpr HapticEffectType HAPTIC_TRIANGLE
Triangle wave effect supported.
Definition SDL3pp_haptic.h:179
void PauseHaptic(HapticRef haptic)
Pause a haptic device.
Definition SDL3pp_haptic.h:1739
bool EffectSupported(const HapticEffect &effect)
Check to see if an effect is supported by a haptic device.
Definition SDL3pp_haptic.h:1508
void SetHapticGain(HapticRef haptic, int gain)
Set the global gain of the specified haptic device.
Definition SDL3pp_haptic.h:1690
void UpdateHapticEffect(HapticRef haptic, HapticEffectID effect, const HapticEffect &data)
Update the properties of an effect.
Definition SDL3pp_haptic.h:1558
constexpr HapticEffectType HAPTIC_RESERVED1
Reserved for future use.
Definition SDL3pp_haptic.h:278
void CloseHaptic(HapticRaw haptic)
Close a haptic device previously opened with OpenHaptic().
Definition SDL3pp_haptic.h:1401
constexpr HapticDirectionType HAPTIC_SPHERICAL
Uses spherical coordinates for the direction.
Definition SDL3pp_haptic.h:383
constexpr HapticEffectType HAPTIC_AUTOCENTER
Device can set autocenter.
Definition SDL3pp_haptic.h:323
static Haptic OpenFromMouse()
Try to open a haptic device from the current mouse.
Definition SDL3pp_haptic.h:1350
HapticID GetID()
Get the instance ID of an opened haptic device.
Definition SDL3pp_haptic.h:1303
constexpr HapticEffectType HAPTIC_SAWTOOTHDOWN
Sawtoothdown wave effect supported.
Definition SDL3pp_haptic.h:201
constexpr HapticDirectionType HAPTIC_CARTESIAN
Uses cartesian coordinates for the direction.
Definition SDL3pp_haptic.h:374
int GetMaxEffects()
Get the number of effects a haptic device can store.
Definition SDL3pp_haptic.h:1426
Uint32 GetHapticFeatures(HapticRef haptic)
Get the haptic device's supported features in bitwise manner.
Definition SDL3pp_haptic.h:1465
SDL_HapticEffect HapticEffect
The generic template for any haptic effect.
Definition SDL3pp_haptic.h:745
const char * GetHapticName(HapticRef haptic)
Get the implementation dependent name of a haptic device.
Definition SDL3pp_haptic.h:1316
constexpr HapticDirectionType HAPTIC_POLAR
Uses polar coordinates for the direction.
Definition SDL3pp_haptic.h:365
bool IsJoystickHaptic(JoystickRef joystick)
Query if a joystick has haptic features.
Definition SDL3pp_haptic.h:1362
void DestroyEffect(HapticEffectID effect)
Destroy a haptic effect on the device.
Definition SDL3pp_haptic.h:1643
constexpr HapticEffectType HAPTIC_CONSTANT
Constant effect supported.
Definition SDL3pp_haptic.h:146
SDL_HapticCustom HapticCustom
A structure containing a template for the HAPTIC_CUSTOM effect.
Definition SDL3pp_haptic.h:671
constexpr HapticEffectType HAPTIC_RESERVED2
Reserved for future use.
Definition SDL3pp_haptic.h:285
HapticRef GetHapticFromID(HapticID instance_id)
Get the Haptic associated with an instance ID, if it has been opened.
Definition SDL3pp_haptic.h:1284
const char * GetName()
Get the implementation dependent name of a haptic device.
Definition SDL3pp_haptic.h:1321
constexpr HapticEffectType HAPTIC_STATUS
Device can be queried for effect status.
Definition SDL3pp_haptic.h:334
OwnArray< HapticID > GetHaptics()
Get a list of currently connected haptic devices.
Definition SDL3pp_haptic.h:1214
Uint32 GetFeatures()
Get the haptic device's supported features in bitwise manner.
Definition SDL3pp_haptic.h:1470
constexpr HapticEffectType HAPTIC_SAWTOOTHUP
Sawtoothup wave effect supported.
Definition SDL3pp_haptic.h:190
void StopHapticEffect(HapticRef haptic, HapticEffectID effect)
Stop the haptic effect on its associated haptic device.
Definition SDL3pp_haptic.h:1615
SDL_HapticPeriodic HapticPeriodic
A structure containing a template for a Periodic effect.
Definition SDL3pp_haptic.h:591
void StopEffects()
Stop all the currently playing effects on a haptic device.
Definition SDL3pp_haptic.h:1781
constexpr HapticEffectType HAPTIC_RAMP
Ramp effect supported.
Definition SDL3pp_haptic.h:212
void Close()
Close a haptic device previously opened with OpenHaptic().
Definition SDL3pp_haptic.h:1403
ResourceRef< Joystick > JoystickRef
Reference for Joystick.
Definition SDL3pp_joystick.h:68
::Uint32 Uint32
An unsigned 32-bit integer type.
Definition SDL3pp_stdinc.h:290
::Uint8 Uint8
An unsigned 8-bit integer type.
Definition SDL3pp_stdinc.h:238
Main include header for the SDL3pp library.
The haptic structure used to identify an SDL haptic.
Definition SDL3pp_haptic.h:771
Haptic & operator=(const Haptic &other)=delete
Assignment operator.
constexpr Haptic(HapticRaw resource) noexcept
Constructs from raw Haptic.
Definition SDL3pp_haptic.h:781
constexpr Haptic & operator=(Haptic &&other) noexcept
Assignment operator.
Definition SDL3pp_haptic.h:863
constexpr Haptic(Haptic &&other) noexcept
Move constructor.
Definition SDL3pp_haptic.h:790
constexpr ResourceBase(RawPointer resource)
Constructs from resource pointer.
Definition SDL3pp_resource.h:29
constexpr Haptic(const Haptic &other)=delete
Copy constructor.
~Haptic()
Destructor.
Definition SDL3pp_haptic.h:860
A non-owning reference wrapper for a given resource.
Definition SDL3pp_resource.h:156