112 #ifndef _SDL_haptic_h
113 #define _SDL_haptic_h
157 #define SDL_HAPTIC_CONSTANT (1<<0)
166 #define SDL_HAPTIC_SINE (1<<1)
177 #define SDL_HAPTIC_LEFTRIGHT (1<<2)
189 #define SDL_HAPTIC_TRIANGLE (1<<3)
198 #define SDL_HAPTIC_SAWTOOTHUP (1<<4)
207 #define SDL_HAPTIC_SAWTOOTHDOWN (1<<5)
216 #define SDL_HAPTIC_RAMP (1<<6)
226 #define SDL_HAPTIC_SPRING (1<<7)
236 #define SDL_HAPTIC_DAMPER (1<<8)
246 #define SDL_HAPTIC_INERTIA (1<<9)
256 #define SDL_HAPTIC_FRICTION (1<<10)
263 #define SDL_HAPTIC_CUSTOM (1<<11)
276 #define SDL_HAPTIC_GAIN (1<<12)
285 #define SDL_HAPTIC_AUTOCENTER (1<<13)
294 #define SDL_HAPTIC_STATUS (1<<14)
302 #define SDL_HAPTIC_PAUSE (1<<15)
315 #define SDL_HAPTIC_POLAR 0
322 #define SDL_HAPTIC_CARTESIAN 1
329 #define SDL_HAPTIC_SPHERICAL 2
344 #define SDL_HAPTIC_INFINITY 4294967295U
819 extern DECLSPEC
const char *SDLCALL
SDL_HapticName(
int device_index);
DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void)
Tries to open a haptic device from the current mouse.
DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index)
Opens a Haptic device for usage.
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic *haptic)
Closes a Haptic device previously opened with SDL_HapticOpen().
Uint16 right_sat[3]
Definition: SDL_haptic.h:607
SDL_HapticCustom custom
Definition: SDL_haptic.h:796
Uint16 interval
Definition: SDL_haptic.h:703
A structure containing a template for the SDL_HAPTIC_CUSTOM effect.
Definition: SDL_haptic.h:691
Sint16 level
Definition: SDL_haptic.h:472
Uint16 samples
Definition: SDL_haptic.h:708
Uint16 fade_level
Definition: SDL_haptic.h:650
struct SDL_HapticRamp SDL_HapticRamp
A structure containing a template for a Ramp effect.
DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic *haptic)
Gets the index of a haptic device.
Uint16 attack_length
Definition: SDL_haptic.h:561
Uint16 large_magnitude
Definition: SDL_haptic.h:674
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
struct _SDL_Haptic SDL_Haptic
The haptic structure used to identify an SDL haptic.
Definition: SDL_haptic.h:135
struct SDL_HapticPeriodic SDL_HapticPeriodic
A structure containing a template for a Periodic effect.
Uint16 fade_level
Definition: SDL_haptic.h:478
DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic *haptic)
Stops all the currently playing effects on a haptic device.
DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic *haptic, int effect)
Stops the haptic effect on its associated haptic device.
Sint16 center[3]
Definition: SDL_haptic.h:612
Uint8 type
Definition: SDL_haptic.h:441
Uint16 button
Definition: SDL_haptic.h:639
Sint32 dir[3]
Definition: SDL_haptic.h:442
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
Uint16 attack_level
Definition: SDL_haptic.h:562
Uint16 period
Definition: SDL_haptic.h:707
Uint16 small_magnitude
Definition: SDL_haptic.h:675
Uint16 fade_length
Definition: SDL_haptic.h:563
Uint16 attack_length
Definition: SDL_haptic.h:712
Uint16 deadband[3]
Definition: SDL_haptic.h:611
Uint16 attack_level
Definition: SDL_haptic.h:476
Uint16 delay
Definition: SDL_haptic.h:636
Uint16 delay
Definition: SDL_haptic.h:548
SDL_HapticConstant constant
Definition: SDL_haptic.h:791
Uint16 button
Definition: SDL_haptic.h:551
Uint16 type
Definition: SDL_haptic.h:460
SDL_HapticDirection direction
Definition: SDL_haptic.h:596
Uint16 button
Definition: SDL_haptic.h:468
DECLSPEC int SDLCALL SDL_HapticOpened(int device_index)
Checks if the haptic device at index has been opened.
Uint16 * data
Definition: SDL_haptic.h:709
Uint16 period
Definition: SDL_haptic.h:555
Uint32 length
Definition: SDL_haptic.h:464
DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic *haptic, int effect, SDL_HapticEffect *data)
Updates the properties of an effect.
A structure containing a template for a Constant effect.
Definition: SDL_haptic.h:457
DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic *haptic)
Initializes the haptic device for simple rumble playback.
Uint16 button
Definition: SDL_haptic.h:702
Uint8 channels
Definition: SDL_haptic.h:706
Uint16 fade_length
Definition: SDL_haptic.h:714
DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic *haptic)
Returns the number of effects a haptic device can play at the same time.
struct SDL_HapticLeftRight SDL_HapticLeftRight
A structure containing a template for a Left/Right effect.
SDL_HapticDirection direction
Definition: SDL_haptic.h:695
DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic *haptic, SDL_HapticEffect *effect)
Creates a new haptic effect on the device.
SDL_HapticDirection direction
Definition: SDL_haptic.h:632
DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic *haptic, float strength, Uint32 length)
Runs simple rumble on a haptic device.
Uint32 length
Definition: SDL_haptic.h:698
Uint16 button
Definition: SDL_haptic.h:603
SDL_HapticDirection direction
Definition: SDL_haptic.h:461
DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect)
Gets the status of the current effect on the haptic device.
Uint32 length
Definition: SDL_haptic.h:547
Uint16 delay
Definition: SDL_haptic.h:600
DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick *joystick)
Opens a Haptic device for usage from a Joystick device.
SDL_HapticCondition condition
Definition: SDL_haptic.h:793
Uint16 type
Definition: SDL_haptic.h:541
Sint16 end
Definition: SDL_haptic.h:644
DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic *haptic, int effect)
Destroys a haptic effect on the device.
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:151
Uint16 fade_length
Definition: SDL_haptic.h:649
Uint16 type
Definition: SDL_haptic.h:631
Uint16 interval
Definition: SDL_haptic.h:469
A structure containing a template for a Periodic effect.
Definition: SDL_haptic.h:538
DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, SDL_HapticEffect *effect)
Checks to see if effect is supported by haptic.
Uint16 type
Definition: SDL_haptic.h:668
Sint16 magnitude
Definition: SDL_haptic.h:556
Sint16 right_coeff[3]
Definition: SDL_haptic.h:609
Uint32 length
Definition: SDL_haptic.h:671
Uint16 fade_length
Definition: SDL_haptic.h:477
Uint16 fade_level
Definition: SDL_haptic.h:715
SDL_HapticDirection direction
Definition: SDL_haptic.h:544
DECLSPEC int SDLCALL SDL_MouseIsHaptic(void)
Gets whether or not the current mouse has haptic capabilities.
DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic *haptic, int effect, Uint32 iterations)
Runs the haptic effect on its associated haptic device.
Uint16 interval
Definition: SDL_haptic.h:640
The generic template for any haptic effect.
Definition: SDL_haptic.h:787
Sint16 left_coeff[3]
Definition: SDL_haptic.h:610
Sint16 offset
Definition: SDL_haptic.h:557
DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter)
Sets the global autocenter of the device.
A structure containing a template for a Condition effect.
Definition: SDL_haptic.h:591
DECLSPEC const char *SDLCALL SDL_HapticName(int device_index)
Get the implementation dependent name of a Haptic device.
DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic *haptic)
Gets the haptic devices supported features in bitwise matter.
struct SDL_HapticCondition SDL_HapticCondition
A structure containing a template for a Condition effect.
SDL_HapticLeftRight leftright
Definition: SDL_haptic.h:795
DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick *joystick)
Checks to see if a joystick has haptic features.
Uint16 delay
Definition: SDL_haptic.h:699
struct SDL_HapticConstant SDL_HapticConstant
A structure containing a template for a Constant effect.
Uint16 delay
Definition: SDL_haptic.h:465
Structure that represents a haptic direction.
Definition: SDL_haptic.h:439
DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic)
Checks to see if rumble is supported on a haptic device.
struct SDL_HapticCustom SDL_HapticCustom
A structure containing a template for the SDL_HAPTIC_CUSTOM effect.
SDL_HapticRamp ramp
Definition: SDL_haptic.h:794
Uint16 type
Definition: SDL_haptic.h:790
DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic *haptic, int gain)
Sets the global gain of the device.
A structure containing a template for a Ramp effect.
Definition: SDL_haptic.h:628
Uint16 fade_level
Definition: SDL_haptic.h:564
Uint16 attack_level
Definition: SDL_haptic.h:648
DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic *haptic)
Unpauses a haptic device.
SDL_HapticPeriodic periodic
Definition: SDL_haptic.h:792
Uint16 attack_length
Definition: SDL_haptic.h:647
DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic *haptic)
Stops the simple rumble on a haptic device.
Uint32 length
Definition: SDL_haptic.h:635
DECLSPEC int SDLCALL SDL_NumHaptics(void)
Count the number of haptic devices attached to the system.
Uint16 type
Definition: SDL_haptic.h:594
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:143
Sint16 start
Definition: SDL_haptic.h:643
Uint16 interval
Definition: SDL_haptic.h:604
DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic *haptic)
Returns the number of effects a haptic device can store.
struct SDL_HapticDirection SDL_HapticDirection
Structure that represents a haptic direction.
Uint16 type
Definition: SDL_haptic.h:694
Uint16 attack_length
Definition: SDL_haptic.h:475
Uint32 length
Definition: SDL_haptic.h:599
DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic *haptic)
Gets the number of haptic axes the device has.
Uint16 attack_level
Definition: SDL_haptic.h:713
Uint16 phase
Definition: SDL_haptic.h:558
DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic *haptic)
Pauses a haptic device.
A structure containing a template for a Left/Right effect.
Definition: SDL_haptic.h:665
union SDL_HapticEffect SDL_HapticEffect
The generic template for any haptic effect.
Uint16 interval
Definition: SDL_haptic.h:552
Uint16 left_sat[3]
Definition: SDL_haptic.h:608