sdl.haptic

SDL Haptic

Members

Aliases

SDL_HapticDirectionType
alias SDL_HapticDirectionType = Uint8

Type of coordinates used for haptic direction.

SDL_HapticEffectID
alias SDL_HapticEffectID = int

ID for haptic effects.

SDL_HapticEffectType
alias SDL_HapticEffectType = Uint16

Type of haptic effect.

SDL_HapticID
alias SDL_HapticID = Uint32

This is a unique ID for a haptic device for the time it is connected to the system, and is never reused for the lifetime of the application.

Functions

SDL_CloseHaptic
void SDL_CloseHaptic(SDL_Haptic* haptic)

Close a haptic device previously opened with SDL_OpenHaptic().

SDL_CreateHapticEffect
SDL_HapticEffectID SDL_CreateHapticEffect(SDL_Haptic* haptic, SDL_HapticEffect* effect)

Create a new haptic effect on a specified device.

SDL_DestroyHapticEffect
void SDL_DestroyHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect)

Destroy a haptic effect on the device.

SDL_GetHapticEffectStatus
bool SDL_GetHapticEffectStatus(SDL_Haptic* haptic, SDL_HapticEffectID effect)

Get the status of the current effect on the specified haptic device.

SDL_GetHapticFeatures
Uint32 SDL_GetHapticFeatures(SDL_Haptic* haptic)

Get the haptic device's supported features in bitwise manner.

SDL_GetHapticFromID
SDL_Haptic* SDL_GetHapticFromID(SDL_HapticID instance_id)

Get the SDL_Haptic associated with an instance ID, if it has been opened.

SDL_GetHapticID
SDL_HapticID SDL_GetHapticID(SDL_Haptic* haptic)

Get the instance ID of an opened haptic device.

SDL_GetHapticName
const(char)* SDL_GetHapticName(SDL_Haptic* haptic)

Get the implementation dependent name of a haptic device.

SDL_GetHapticNameForID
const(char)* SDL_GetHapticNameForID(SDL_HapticID instance_id)

Get the implementation dependent name of a haptic device.

SDL_GetHaptics
SDL_HapticID* SDL_GetHaptics(int* count)

Get a list of currently connected haptic devices.

SDL_GetMaxHapticEffects
int SDL_GetMaxHapticEffects(SDL_Haptic* haptic)

Get the number of effects a haptic device can store.

SDL_GetMaxHapticEffectsPlaying
int SDL_GetMaxHapticEffectsPlaying(SDL_Haptic* haptic)

Get the number of effects a haptic device can play at the same time.

SDL_GetNumHapticAxes
int SDL_GetNumHapticAxes(SDL_Haptic* haptic)

Get the number of haptic axes the device has.

SDL_HapticEffectSupported
bool SDL_HapticEffectSupported(SDL_Haptic* haptic, SDL_HapticEffect* effect)

Check to see if an effect is supported by a haptic device.

SDL_HapticRumbleSupported
bool SDL_HapticRumbleSupported(SDL_Haptic* haptic)

Check whether rumble is supported on a haptic device.

SDL_InitHapticRumble
bool SDL_InitHapticRumble(SDL_Haptic* haptic)

Initialize a haptic device for simple rumble playback.

SDL_IsJoystickHaptic
bool SDL_IsJoystickHaptic(SDL_Joystick* joystick)

Query if a joystick has haptic features.

SDL_IsMouseHaptic
bool SDL_IsMouseHaptic()

Query whether or not the current mouse has haptic capabilities.

SDL_OpenHaptic
SDL_Haptic* SDL_OpenHaptic(SDL_HapticID instance_id)

Open a haptic device for use.

SDL_OpenHapticFromJoystick
SDL_Haptic* SDL_OpenHapticFromJoystick(SDL_Joystick* joystick)

Open a haptic device for use from a joystick device.

SDL_OpenHapticFromMouse
SDL_Haptic* SDL_OpenHapticFromMouse()

Try to open a haptic device from the current mouse.

SDL_PauseHaptic
bool SDL_PauseHaptic(SDL_Haptic* haptic)

Pause a haptic device.

SDL_PlayHapticRumble
bool SDL_PlayHapticRumble(SDL_Haptic* haptic, float strength, Uint32 length)

Run a simple rumble effect on a haptic device.

SDL_ResumeHaptic
bool SDL_ResumeHaptic(SDL_Haptic* haptic)

Resume a haptic device.

SDL_RunHapticEffect
bool SDL_RunHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect, Uint32 iterations)

Run the haptic effect on its associated haptic device.

SDL_SetHapticAutocenter
bool SDL_SetHapticAutocenter(SDL_Haptic* haptic, int autocenter)

Set the global autocenter of the device.

SDL_SetHapticGain
bool SDL_SetHapticGain(SDL_Haptic* haptic, int gain)

Set the global gain of the specified haptic device.

SDL_StopHapticEffect
bool SDL_StopHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect)

Stop the haptic effect on its associated haptic device.

SDL_StopHapticEffects
bool SDL_StopHapticEffects(SDL_Haptic* haptic)

Stop all the currently playing effects on a haptic device.

SDL_StopHapticRumble
bool SDL_StopHapticRumble(SDL_Haptic* haptic)

Stop the simple rumble on a haptic device.

SDL_UpdateHapticEffect
bool SDL_UpdateHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect, SDL_HapticEffect* data)

Update the properties of an effect.

Manifest constants

SDL_HAPTIC_AUTOCENTER
enum SDL_HAPTIC_AUTOCENTER;

Device can set autocenter.

SDL_HAPTIC_CARTESIAN
enum SDL_HAPTIC_CARTESIAN;

Uses cartesian coordinates for the direction.

SDL_HAPTIC_CONSTANT
enum SDL_HAPTIC_CONSTANT;

Constant effect supported.

SDL_HAPTIC_CUSTOM
enum SDL_HAPTIC_CUSTOM;

Custom effect is supported.

SDL_HAPTIC_DAMPER
enum SDL_HAPTIC_DAMPER;

Damper effect supported - uses axes velocity.

SDL_HAPTIC_FRICTION
enum SDL_HAPTIC_FRICTION;

Friction effect supported - uses axes movement.

SDL_HAPTIC_GAIN
enum SDL_HAPTIC_GAIN;

Device can set global gain.

SDL_HAPTIC_INERTIA
enum SDL_HAPTIC_INERTIA;

Inertia effect supported - uses axes acceleration.

SDL_HAPTIC_INFINITY
enum SDL_HAPTIC_INFINITY;

Used to play a device an infinite number of times.

SDL_HAPTIC_LEFTRIGHT
enum SDL_HAPTIC_LEFTRIGHT;

Left/Right effect supported.

SDL_HAPTIC_PAUSE
enum SDL_HAPTIC_PAUSE;

Device can be paused.

SDL_HAPTIC_POLAR
enum SDL_HAPTIC_POLAR;

Uses polar coordinates for the direction.

SDL_HAPTIC_RAMP
enum SDL_HAPTIC_RAMP;

Ramp effect supported.

SDL_HAPTIC_RESERVED1
enum SDL_HAPTIC_RESERVED1;

Reserved for future use.

SDL_HAPTIC_RESERVED2
enum SDL_HAPTIC_RESERVED2;

Reserved for future use.

SDL_HAPTIC_RESERVED3
enum SDL_HAPTIC_RESERVED3;

Reserved for future use.

SDL_HAPTIC_SAWTOOTHDOWN
enum SDL_HAPTIC_SAWTOOTHDOWN;

Sawtoothdown wave effect supported.

SDL_HAPTIC_SAWTOOTHUP
enum SDL_HAPTIC_SAWTOOTHUP;

Sawtoothup wave effect supported.

SDL_HAPTIC_SINE
enum SDL_HAPTIC_SINE;

Sine wave effect supported.

SDL_HAPTIC_SPHERICAL
enum SDL_HAPTIC_SPHERICAL;

Uses spherical coordinates for the direction.

SDL_HAPTIC_SPRING
enum SDL_HAPTIC_SPRING;

Spring effect supported - uses axes position.

SDL_HAPTIC_SQUARE
enum SDL_HAPTIC_SQUARE;

Square wave effect supported.

SDL_HAPTIC_STATUS
enum SDL_HAPTIC_STATUS;

Device can be queried for effect status.

SDL_HAPTIC_STEERING_AXIS
enum SDL_HAPTIC_STEERING_AXIS;

Use this value to play an effect on the steering wheel axis.

SDL_HAPTIC_TRIANGLE
enum SDL_HAPTIC_TRIANGLE;

Triangle wave effect supported.

Structs

SDL_Haptic
struct SDL_Haptic

The haptic structure used to identify an SDL haptic.

SDL_HapticCondition
struct SDL_HapticCondition

A structure containing a template for a Condition effect.

SDL_HapticConstant
struct SDL_HapticConstant

A structure containing a template for a Constant effect.

SDL_HapticCustom
struct SDL_HapticCustom

A structure containing a template for the SDL_HAPTIC_CUSTOM effect.

SDL_HapticDirection
struct SDL_HapticDirection

Structure that represents a haptic direction.

SDL_HapticLeftRight
struct SDL_HapticLeftRight

A structure containing a template for a Left/Right effect.

SDL_HapticPeriodic
struct SDL_HapticPeriodic

A structure containing a template for a Periodic effect.

SDL_HapticRamp
struct SDL_HapticRamp

A structure containing a template for a Ramp effect.

Unions

SDL_HapticEffect
union SDL_HapticEffect

The generic template for any haptic effect.

See Also

Meta

License

Subject to the terms of the Zlib License, as written in the LICENSE file.

Authors

Luna Nielsen