@@ -149,6 +149,19 @@ extern "C" {
149
149
*/
150
150
typedef struct SDL_Haptic SDL_Haptic ;
151
151
152
+ /*
153
+ * Misc defines.
154
+ */
155
+
156
+ /**
157
+ * Used to play a device an infinite number of times.
158
+ *
159
+ * \since This macro is available since SDL 3.2.0.
160
+ *
161
+ * \sa SDL_RunHapticEffect
162
+ */
163
+ #define SDL_HAPTIC_INFINITY 4294967295U
164
+
152
165
153
166
/**
154
167
* \name Haptic features
@@ -162,6 +175,11 @@ typedef struct SDL_Haptic SDL_Haptic;
162
175
*/
163
176
/* @{ */
164
177
178
+ /**
179
+ * Type of haptic effect.
180
+ */
181
+ typedef Uint16 SDL_HapticEffectType ;
182
+
165
183
/**
166
184
* Constant effect supported.
167
185
*
@@ -383,6 +401,11 @@ typedef struct SDL_Haptic SDL_Haptic;
383
401
*/
384
402
/* @{ */
385
403
404
+ /**
405
+ * Type of coordinates used for haptic direction.
406
+ */
407
+ typedef Uint8 SDL_HapticDirectionType ;
408
+
386
409
/**
387
410
* Uses polar coordinates for the direction.
388
411
*
@@ -426,19 +449,6 @@ typedef struct SDL_Haptic SDL_Haptic;
426
449
427
450
/* @} */ /* Haptic features */
428
451
429
- /*
430
- * Misc defines.
431
- */
432
-
433
- /**
434
- * Used to play a device an infinite number of times.
435
- *
436
- * \since This macro is available since SDL 3.2.0.
437
- *
438
- * \sa SDL_RunHapticEffect
439
- */
440
- #define SDL_HAPTIC_INFINITY 4294967295U
441
-
442
452
443
453
/**
444
454
* Structure that represents a haptic direction.
@@ -545,8 +555,8 @@ typedef struct SDL_Haptic SDL_Haptic;
545
555
*/
546
556
typedef struct SDL_HapticDirection
547
557
{
548
- Uint8 type ; /**< The type of encoding. */
549
- Sint32 dir [3 ]; /**< The encoded direction. */
558
+ SDL_HapticDirectionType type ; /**< The type of encoding. */
559
+ Sint32 dir [3 ]; /**< The encoded direction. */
550
560
} SDL_HapticDirection ;
551
561
552
562
@@ -566,7 +576,7 @@ typedef struct SDL_HapticDirection
566
576
typedef struct SDL_HapticConstant
567
577
{
568
578
/* Header */
569
- Uint16 type ; /**< SDL_HAPTIC_CONSTANT */
579
+ SDL_HapticEffectType type ; /**< SDL_HAPTIC_CONSTANT */
570
580
SDL_HapticDirection direction ; /**< Direction of the effect. */
571
581
572
582
/* Replay */
@@ -652,9 +662,9 @@ typedef struct SDL_HapticConstant
652
662
typedef struct SDL_HapticPeriodic
653
663
{
654
664
/* Header */
655
- Uint16 type ; /**< SDL_HAPTIC_SINE, SDL_HAPTIC_SQUARE
656
- SDL_HAPTIC_TRIANGLE, SDL_HAPTIC_SAWTOOTHUP or
657
- SDL_HAPTIC_SAWTOOTHDOWN */
665
+ SDL_HapticEffectType type ; /**< SDL_HAPTIC_SINE, SDL_HAPTIC_SQUARE
666
+ SDL_HAPTIC_TRIANGLE, SDL_HAPTIC_SAWTOOTHUP or
667
+ SDL_HAPTIC_SAWTOOTHDOWN */
658
668
SDL_HapticDirection direction ; /**< Direction of the effect. */
659
669
660
670
/* Replay */
@@ -708,8 +718,8 @@ typedef struct SDL_HapticPeriodic
708
718
typedef struct SDL_HapticCondition
709
719
{
710
720
/* Header */
711
- Uint16 type ; /**< SDL_HAPTIC_SPRING, SDL_HAPTIC_DAMPER,
712
- SDL_HAPTIC_INERTIA or SDL_HAPTIC_FRICTION */
721
+ SDL_HapticEffectType type ; /**< SDL_HAPTIC_SPRING, SDL_HAPTIC_DAMPER,
722
+ SDL_HAPTIC_INERTIA or SDL_HAPTIC_FRICTION */
713
723
SDL_HapticDirection direction ; /**< Direction of the effect. */
714
724
715
725
/* Replay */
@@ -747,7 +757,7 @@ typedef struct SDL_HapticCondition
747
757
typedef struct SDL_HapticRamp
748
758
{
749
759
/* Header */
750
- Uint16 type ; /**< SDL_HAPTIC_RAMP */
760
+ SDL_HapticEffectType type ; /**< SDL_HAPTIC_RAMP */
751
761
SDL_HapticDirection direction ; /**< Direction of the effect. */
752
762
753
763
/* Replay */
@@ -786,7 +796,7 @@ typedef struct SDL_HapticRamp
786
796
typedef struct SDL_HapticLeftRight
787
797
{
788
798
/* Header */
789
- Uint16 type ; /**< SDL_HAPTIC_LEFTRIGHT */
799
+ SDL_HapticEffectType type ; /**< SDL_HAPTIC_LEFTRIGHT */
790
800
791
801
/* Replay */
792
802
Uint32 length ; /**< Duration of the effect in milliseconds. */
@@ -816,7 +826,7 @@ typedef struct SDL_HapticLeftRight
816
826
typedef struct SDL_HapticCustom
817
827
{
818
828
/* Header */
819
- Uint16 type ; /**< SDL_HAPTIC_CUSTOM */
829
+ SDL_HapticEffectType type ; /**< SDL_HAPTIC_CUSTOM */
820
830
SDL_HapticDirection direction ; /**< Direction of the effect. */
821
831
822
832
/* Replay */
@@ -915,7 +925,7 @@ typedef struct SDL_HapticCustom
915
925
typedef union SDL_HapticEffect
916
926
{
917
927
/* Common for all force feedback effects */
918
- Uint16 type ; /**< Effect type. */
928
+ SDL_HapticEffectType type ; /**< Effect type. */
919
929
SDL_HapticConstant constant ; /**< Constant effect. */
920
930
SDL_HapticPeriodic periodic ; /**< Periodic effect. */
921
931
SDL_HapticCondition condition ; /**< Condition effect. */
0 commit comments