| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Haptic.Unsafe
Synopsis
- sDL_GetHaptics :: Ptr CInt -> IO (Ptr SDL_HapticID)
- sDL_GetHapticNameForID :: SDL_HapticID -> IO (PtrConst CChar)
- sDL_OpenHaptic :: SDL_HapticID -> IO (Ptr SDL_Haptic)
- sDL_GetHapticFromID :: SDL_HapticID -> IO (Ptr SDL_Haptic)
- sDL_GetHapticID :: Ptr SDL_Haptic -> IO SDL_HapticID
- sDL_GetHapticName :: Ptr SDL_Haptic -> IO (PtrConst CChar)
- sDL_IsMouseHaptic :: IO CBool
- sDL_OpenHapticFromMouse :: IO (Ptr SDL_Haptic)
- sDL_IsJoystickHaptic :: Ptr SDL_Joystick -> IO CBool
- sDL_OpenHapticFromJoystick :: Ptr SDL_Joystick -> IO (Ptr SDL_Haptic)
- sDL_CloseHaptic :: Ptr SDL_Haptic -> IO ()
- sDL_GetMaxHapticEffects :: Ptr SDL_Haptic -> IO CInt
- sDL_GetMaxHapticEffectsPlaying :: Ptr SDL_Haptic -> IO CInt
- sDL_GetHapticFeatures :: Ptr SDL_Haptic -> IO Uint32
- sDL_GetNumHapticAxes :: Ptr SDL_Haptic -> IO CInt
- sDL_HapticEffectSupported :: Ptr SDL_Haptic -> PtrConst SDL_HapticEffect -> IO CBool
- sDL_CreateHapticEffect :: Ptr SDL_Haptic -> PtrConst SDL_HapticEffect -> IO SDL_HapticEffectID
- sDL_UpdateHapticEffect :: Ptr SDL_Haptic -> SDL_HapticEffectID -> PtrConst SDL_HapticEffect -> IO CBool
- sDL_RunHapticEffect :: Ptr SDL_Haptic -> SDL_HapticEffectID -> Uint32 -> IO CBool
- sDL_StopHapticEffect :: Ptr SDL_Haptic -> SDL_HapticEffectID -> IO CBool
- sDL_DestroyHapticEffect :: Ptr SDL_Haptic -> SDL_HapticEffectID -> IO ()
- sDL_GetHapticEffectStatus :: Ptr SDL_Haptic -> SDL_HapticEffectID -> IO CBool
- sDL_SetHapticGain :: Ptr SDL_Haptic -> CInt -> IO CBool
- sDL_SetHapticAutocenter :: Ptr SDL_Haptic -> CInt -> IO CBool
- sDL_PauseHaptic :: Ptr SDL_Haptic -> IO CBool
- sDL_ResumeHaptic :: Ptr SDL_Haptic -> IO CBool
- sDL_StopHapticEffects :: Ptr SDL_Haptic -> IO CBool
- sDL_HapticRumbleSupported :: Ptr SDL_Haptic -> IO CBool
- sDL_InitHapticRumble :: Ptr SDL_Haptic -> IO CBool
- sDL_PlayHapticRumble :: Ptr SDL_Haptic -> CFloat -> Uint32 -> IO CBool
- sDL_StopHapticRumble :: Ptr SDL_Haptic -> IO CBool
Documentation
Arguments
| :: Ptr CInt |
|
| -> IO (Ptr SDL_HapticID) |
Get a list of currently connected haptic devices.
- Returns
- a 0 terminated array of haptic device instance IDs or NULL on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
- See also
sDL_OpenHaptic- C declaration
SDL_GetHaptics, defined atSDL3/SDL_haptic.h 975:44
Since: 3.2.0
sDL_GetHapticNameForID Source #
Arguments
| :: SDL_HapticID |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent name of a haptic device.
This can be called before any haptic devices are opened.
- Returns
- the name of the selected haptic device. If no name can be found, this function returns NULL; call SDL_GetError() for more information.
- See also
sDL_GetHapticName,sDL_OpenHaptic- C declaration
SDL_GetHapticNameForID, defined atSDL3/SDL_haptic.h 992:42
Since: 3.2.0
Arguments
| :: SDL_HapticID |
|
| -> IO (Ptr SDL_Haptic) |
Open a haptic device for use.
The index passed as an argument refers to the N'th haptic device on this system.
When opening a haptic device, its gain will be set to maximum and autocenter will be disabled. To modify these values use SDL_SetHapticGain() and SDL_SetHapticAutocenter().
- Returns
- the device identifier or NULL on failure; call SDL_GetError() for more information.
- See also
sDL_CloseHaptic,sDL_GetHaptics,sDL_OpenHapticFromJoystick,sDL_OpenHapticFromMouse,sDL_SetHapticAutocenter,sDL_SetHapticGain- C declaration
SDL_OpenHaptic, defined atSDL3/SDL_haptic.h 1017:42
Since: 3.2.0
Arguments
| :: SDL_HapticID |
|
| -> IO (Ptr SDL_Haptic) |
Get the SDL_Haptic associated with an instance ID, if it has been opened.
- Returns
- an
SDL_Hapticon success or NULL on failure or if it hasn't been opened yet; call SDL_GetError() for more information. - C declaration
SDL_GetHapticFromID, defined atSDL3/SDL_haptic.h 1029:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO SDL_HapticID |
Get the instance ID of an opened haptic device.
- Returns
- the instance ID of the specified haptic device on success or 0 on failure; call SDL_GetError() for more information.
- C declaration
SDL_GetHapticID, defined atSDL3/SDL_haptic.h 1040:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent name of a haptic device.
- Returns
- the name of the selected haptic device. If no name can be found, this function returns NULL; call SDL_GetError() for more information.
- See also
sDL_GetHapticNameForID- C declaration
SDL_GetHapticName, defined atSDL3/SDL_haptic.h 1054:42
Since: 3.2.0
sDL_IsMouseHaptic :: IO CBool Source #
Query whether or not the current mouse has haptic capabilities.
- Returns
- true if the mouse is haptic or false if it isn't.
- See also
sDL_OpenHapticFromMouse- C declaration
SDL_IsMouseHaptic, defined atSDL3/SDL_haptic.h 1065:34
Since: 3.2.0
sDL_OpenHapticFromMouse :: IO (Ptr SDL_Haptic) Source #
Try to open a haptic device from the current mouse.
- Returns
- the haptic device identifier or NULL on failure; call SDL_GetError() for more information.
- See also
sDL_CloseHaptic,sDL_IsMouseHaptic- C declaration
SDL_OpenHapticFromMouse, defined atSDL3/SDL_haptic.h 1078:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO CBool |
Query if a joystick has haptic features.
- Returns
- true if the joystick is haptic or false if it isn't.
- See also
sDL_OpenHapticFromJoystick- C declaration
SDL_IsJoystickHaptic, defined atSDL3/SDL_haptic.h 1090:34
Since: 3.2.0
sDL_OpenHapticFromJoystick Source #
Arguments
| :: Ptr SDL_Joystick |
|
| -> IO (Ptr SDL_Haptic) |
Open a haptic device for use from a joystick device.
You must still close the haptic device separately. It will not be closed with the joystick.
When opened from a joystick you should first close the haptic device before closing the joystick device. If not, on some implementations the haptic device will also get unallocated and you'll be unable to use force feedback on that device.
- Returns
- a valid haptic device identifier on success or NULL on failure; call SDL_GetError() for more information.
- See also
sDL_CloseHaptic,sDL_IsJoystickHaptic- C declaration
SDL_OpenHapticFromJoystick, defined atSDL3/SDL_haptic.h 1112:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO () |
Close a haptic device previously opened with SDL_OpenHaptic().
- See also
sDL_OpenHaptic- C declaration
SDL_CloseHaptic, defined atSDL3/SDL_haptic.h 1123:34
Since: 3.2.0
sDL_GetMaxHapticEffects Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO CInt |
Get the number of effects a haptic device can store.
On some platforms this isn't fully supported, and therefore is an approximation. Always check to see if your created effect was actually created and do not rely solely on SDL_GetMaxHapticEffects().
- Returns
- the number of effects the haptic device can store or a negative error code on failure; call SDL_GetError() for more information.
- See also
sDL_GetMaxHapticEffectsPlaying,sDL_GetHapticFeatures- C declaration
SDL_GetMaxHapticEffects, defined atSDL3/SDL_haptic.h 1141:33
Since: 3.2.0
sDL_GetMaxHapticEffectsPlaying Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO CInt |
Get the number of effects a haptic device can play at the same time.
This is not supported on all platforms, but will always return a value.
- Returns
- the number of effects the haptic device can play at the same time or -1 on failure; call SDL_GetError() for more information.
- See also
sDL_GetMaxHapticEffects,sDL_GetHapticFeatures- C declaration
SDL_GetMaxHapticEffectsPlaying, defined atSDL3/SDL_haptic.h 1157:33
Since: 3.2.0
sDL_GetHapticFeatures Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO Uint32 |
Get the haptic device's supported features in bitwise manner.
- Returns
- a list of supported haptic features in bitwise manner (OR'd), or 0 on failure; call SDL_GetError() for more information.
- See also
sDL_HapticEffectSupported,sDL_GetMaxHapticEffects- C declaration
SDL_GetHapticFeatures, defined atSDL3/SDL_haptic.h 1171:36
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO CInt |
Get the number of haptic axes the device has.
The number of haptic axes might be useful if working with the SDL_HapticDirection effect.
- Returns
- the number of axes on success or -1 on failure; call SDL_GetError() for more information.
- C declaration
SDL_GetNumHapticAxes, defined atSDL3/SDL_haptic.h 1185:33
Since: 3.2.0
sDL_HapticEffectSupported Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> PtrConst SDL_HapticEffect |
|
| -> IO CBool |
Check to see if an effect is supported by a haptic device.
- Returns
- true if the effect is supported or false if it isn't.
- See also
sDL_CreateHapticEffect,sDL_GetHapticFeatures- C declaration
SDL_HapticEffectSupported, defined atSDL3/SDL_haptic.h 1199:34
Since: 3.2.0
sDL_CreateHapticEffect Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> PtrConst SDL_HapticEffect |
|
| -> IO SDL_HapticEffectID |
Create a new haptic effect on a specified device.
- Returns
- the ID of the effect on success or -1 on failure; call SDL_GetError() for more information.
- See also
sDL_DestroyHapticEffect,sDL_RunHapticEffect,sDL_UpdateHapticEffect- C declaration
SDL_CreateHapticEffect, defined atSDL3/SDL_haptic.h 1216:48
Since: 3.2.0
sDL_UpdateHapticEffect Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> SDL_HapticEffectID |
|
| -> PtrConst SDL_HapticEffect |
|
| -> IO CBool |
Update the properties of an effect.
Can be used dynamically, although behavior when dynamically changing direction may be strange. Specifically the effect may re-upload itself and start playing from the start. You also cannot change the type either when running SDL_UpdateHapticEffect().
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_CreateHapticEffect,sDL_RunHapticEffect- C declaration
SDL_UpdateHapticEffect, defined atSDL3/SDL_haptic.h 1238:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> SDL_HapticEffectID |
|
| -> Uint32 |
|
| -> IO CBool |
Run the haptic effect on its associated haptic device.
To repeat the effect over and over indefinitely, set iterations to . (Repeats the envelope - attack and fade.) To make one instance of the effect last indefinitely (so the effect does not fade), set the effect's sDL_HAPTIC_INFINITYlength in its structure/union to instead.sDL_HAPTIC_INFINITY
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_GetHapticEffectStatus,sDL_StopHapticEffect,sDL_StopHapticEffects- C declaration
SDL_RunHapticEffect, defined atSDL3/SDL_haptic.h 1262:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> SDL_HapticEffectID |
|
| -> IO CBool |
Stop the haptic effect on its associated haptic device.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_RunHapticEffect,sDL_StopHapticEffects- C declaration
SDL_StopHapticEffect, defined atSDL3/SDL_haptic.h 1277:34
Since: 3.2.0
sDL_DestroyHapticEffect Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> SDL_HapticEffectID |
|
| -> IO () |
Destroy a haptic effect on the device.
This will stop the effect if it's running. Effects are automatically destroyed when the device is closed.
- See also
sDL_CreateHapticEffect- C declaration
SDL_DestroyHapticEffect, defined atSDL3/SDL_haptic.h 1292:34
Since: 3.2.0
sDL_GetHapticEffectStatus Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> SDL_HapticEffectID |
|
| -> IO CBool |
Get the status of the current effect on the specified haptic device.
Device must support the SDL_HAPTIC_STATUS feature.
- Returns
- true if it is playing, false if it isn't playing or haptic status isn't supported.
- See also
sDL_GetHapticFeatures- C declaration
SDL_GetHapticEffectStatus, defined atSDL3/SDL_haptic.h 1308:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> CInt |
|
| -> IO CBool |
Set the global gain of the specified haptic device.
Device must support the SDL_HAPTIC_GAIN feature.
The user may specify the maximum gain by setting the environment variable SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to SDL_SetHapticGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the maximum.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_GetHapticFeatures- C declaration
SDL_SetHapticGain, defined atSDL3/SDL_haptic.h 1330:34
Since: 3.2.0
sDL_SetHapticAutocenter Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> CInt |
|
| -> IO CBool |
Set the global autocenter of the device.
Autocenter should be between 0 and 100. Setting it to 0 will disable autocentering.
Device must support the SDL_HAPTIC_AUTOCENTER feature.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_GetHapticFeatures- C declaration
SDL_SetHapticAutocenter, defined atSDL3/SDL_haptic.h 1349:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO CBool |
Pause a haptic device.
Device must support the feature. Call sDL_HAPTIC_PAUSESDL_ResumeHaptic() to resume playback.
Do not modify the effects nor add new ones while the device is paused. That can cause all sorts of weird errors.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_ResumeHaptic- C declaration
SDL_PauseHaptic, defined atSDL3/SDL_haptic.h 1368:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO CBool |
Resume a haptic device.
Call to unpause after SDL_PauseHaptic().
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_PauseHaptic- C declaration
SDL_ResumeHaptic, defined atSDL3/SDL_haptic.h 1383:34
Since: 3.2.0
sDL_StopHapticEffects Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO CBool |
Stop all the currently playing effects on a haptic device.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_RunHapticEffect,sDL_StopHapticEffect- C declaration
SDL_StopHapticEffects, defined atSDL3/SDL_haptic.h 1397:34
Since: 3.2.0
sDL_HapticRumbleSupported Source #
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO CBool |
Check whether rumble is supported on a haptic device.
- Returns
- true if the effect is supported or false if it isn't.
- See also
sDL_InitHapticRumble- C declaration
SDL_HapticRumbleSupported, defined atSDL3/SDL_haptic.h 1409:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO CBool |
Initialize a haptic device for simple rumble playback.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_PlayHapticRumble,sDL_StopHapticRumble,sDL_HapticRumbleSupported- C declaration
SDL_InitHapticRumble, defined atSDL3/SDL_haptic.h 1424:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> CFloat |
|
| -> Uint32 |
|
| -> IO CBool |
Run a simple rumble effect on a haptic device.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_InitHapticRumble,sDL_StopHapticRumble- C declaration
SDL_PlayHapticRumble, defined atSDL3/SDL_haptic.h 1440:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Haptic |
|
| -> IO CBool |
Stop the simple rumble on a haptic device.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- See also
sDL_PlayHapticRumble- C declaration
SDL_StopHapticRumble, defined atSDL3/SDL_haptic.h 1453:34
Since: 3.2.0