{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE NoImplicitPrelude #-} -- | The SDL haptic subsystem manages haptic (force feedback) devices. -- -- The basic usage is as follows: -- -- * Initialize the subsystem (SDL_INIT_HAPTIC). -- -- * Open a haptic device. -- -- * @'openHaptic'@ to open from index. -- -- * @'openHapticFromJoystick'@ to open from an existing joystick. -- -- * Create an effect ('SDL_HapticEffect'). -- -- * Upload the effect with @'createHapticEffect'@. -- -- * Run the effect with @'runHapticEffect'@. -- -- * (optional) Free the effect with @'destroyHapticEffect'@. -- -- * Close the haptic device with @'closeHaptic'@. -- -- Simple rumble example: -- -- @ -- SDL_Haptic *haptic = NULL; -- -- \/\/ Open the device -- SDL_HapticID *haptics = SDL_GetHaptics(NULL); -- if (haptics) { -- haptic = SDL_OpenHaptic(haptics[0]); -- SDL_free(haptics); -- } -- if (haptic == NULL) -- return; -- -- \/\/ Initialize simple rumble -- if (!SDL_InitHapticRumble(haptic)) -- return; -- -- \/\/ Play effect at 50% strength for 2 seconds -- if (!SDL_PlayHapticRumble(haptic, 0.5, 2000)) -- return; -- SDL_Delay(2000); -- -- \/\/ Clean up -- SDL_CloseHaptic(haptic); -- @ -- -- Complete example: -- -- @ -- bool test_haptic(SDL_Joystick *joystick) -- { -- SDL_Haptic *haptic; -- SDL_HapticEffect effect; -- SDL_HapticEffectID effect_id; -- -- \/\/ Open the device -- haptic = SDL_OpenHapticFromJoystick(joystick); -- if (haptic == NULL) return false; \/\/ Most likely joystick isn\'t haptic -- -- \/\/ See if it can do sine waves -- if ((SDL_GetHapticFeatures(haptic) & SDL_HAPTIC_SINE)==0) { -- SDL_CloseHaptic(haptic); \/\/ No sine effect -- return false; -- } -- -- \/\/ Create the effect -- SDL_memset(&effect, 0, sizeof(SDL_HapticEffect)); \/\/ 0 is safe default -- effect.type = SDL_HAPTIC_SINE; -- effect.periodic.direction.type = SDL_HAPTIC_POLAR; \/\/ Polar coordinates -- effect.periodic.direction.dir[0] = 18000; \/\/ Force comes from south -- effect.periodic.period = 1000; \/\/ 1000 ms -- effect.periodic.magnitude = 20000; \/\/ 20000\/32767 strength -- effect.periodic.length = 5000; \/\/ 5 seconds long -- effect.periodic.attack_length = 1000; \/\/ Takes 1 second to get max strength -- effect.periodic.fade_length = 1000; \/\/ Takes 1 second to fade away -- -- \/\/ Upload the effect -- effect_id = SDL_CreateHapticEffect(haptic, &effect); -- -- \/\/ Test the effect -- SDL_RunHapticEffect(haptic, effect_id, 1); -- SDL_Delay(5000); \/\/ Wait for the effect to finish -- -- \/\/ We destroy the effect, although closing the device also does this -- SDL_DestroyHapticEffect(haptic, effect_id); -- -- \/\/ Close the device -- SDL_CloseHaptic(haptic); -- -- return true; \/\/ Success -- } -- @ -- -- Note that the SDL haptic subsystem is not thread-safe. The haptic structure used to identify an SDL haptic. -- -- @since 3.2.0 -- -- [See also]: 'openHaptic', 'openHapticFromJoystick', 'closeHaptic' -- -- == FFI conventions -- -- Unsuffixed aliases are __unsafe__ foreign imports; aliases suffixed @Safe@ are safe. Functions whose callbacks fire during the call export only the Safe alias (the genuine unsafe import stays reachable under @SDL3.Sys.Bindgen.Haptic.Unsafe@); functions curated unsafe-only export only the unsuffixed one. Each alias\'s documentation records its flavor and rationale. -- -- Full conventions: "SDL3.Sys". module SDL3.Sys.Haptic ( module SDL3.Sys.Bindgen.Haptic, -- * Typed constants pattern SDL3.Sys.Haptic.SDL_HAPTIC_POLAR, pattern SDL3.Sys.Haptic.SDL_HAPTIC_CARTESIAN, pattern SDL3.Sys.Haptic.SDL_HAPTIC_SPHERICAL, pattern SDL3.Sys.Haptic.SDL_HAPTIC_STEERING_AXIS, pattern SDL3.Sys.Haptic.SDL_HAPTIC_CONSTANT, pattern SDL3.Sys.Haptic.SDL_HAPTIC_SINE, pattern SDL3.Sys.Haptic.SDL_HAPTIC_SQUARE, pattern SDL3.Sys.Haptic.SDL_HAPTIC_TRIANGLE, pattern SDL3.Sys.Haptic.SDL_HAPTIC_SAWTOOTHUP, pattern SDL3.Sys.Haptic.SDL_HAPTIC_SAWTOOTHDOWN, pattern SDL3.Sys.Haptic.SDL_HAPTIC_RAMP, pattern SDL3.Sys.Haptic.SDL_HAPTIC_SPRING, pattern SDL3.Sys.Haptic.SDL_HAPTIC_DAMPER, pattern SDL3.Sys.Haptic.SDL_HAPTIC_INERTIA, pattern SDL3.Sys.Haptic.SDL_HAPTIC_FRICTION, pattern SDL3.Sys.Haptic.SDL_HAPTIC_LEFTRIGHT, pattern SDL3.Sys.Haptic.SDL_HAPTIC_RESERVED1, pattern SDL3.Sys.Haptic.SDL_HAPTIC_RESERVED2, pattern SDL3.Sys.Haptic.SDL_HAPTIC_RESERVED3, pattern SDL3.Sys.Haptic.SDL_HAPTIC_CUSTOM, -- * Function aliases SDL3.Sys.Haptic.getHaptics, SDL3.Sys.Haptic.getHapticsSafe, SDL3.Sys.Haptic.getHapticNameForID, SDL3.Sys.Haptic.getHapticNameForIDSafe, SDL3.Sys.Haptic.openHaptic, SDL3.Sys.Haptic.openHapticSafe, SDL3.Sys.Haptic.getHapticFromID, SDL3.Sys.Haptic.getHapticFromIDSafe, SDL3.Sys.Haptic.getHapticID, SDL3.Sys.Haptic.getHapticIDSafe, SDL3.Sys.Haptic.getHapticName, SDL3.Sys.Haptic.getHapticNameSafe, SDL3.Sys.Haptic.isMouseHaptic, SDL3.Sys.Haptic.isMouseHapticSafe, SDL3.Sys.Haptic.openHapticFromMouse, SDL3.Sys.Haptic.openHapticFromMouseSafe, SDL3.Sys.Haptic.isJoystickHaptic, SDL3.Sys.Haptic.isJoystickHapticSafe, SDL3.Sys.Haptic.openHapticFromJoystick, SDL3.Sys.Haptic.openHapticFromJoystickSafe, SDL3.Sys.Haptic.closeHaptic, SDL3.Sys.Haptic.closeHapticSafe, SDL3.Sys.Haptic.getMaxHapticEffects, SDL3.Sys.Haptic.getMaxHapticEffectsSafe, SDL3.Sys.Haptic.getMaxHapticEffectsPlaying, SDL3.Sys.Haptic.getMaxHapticEffectsPlayingSafe, SDL3.Sys.Haptic.getHapticFeatures, SDL3.Sys.Haptic.getHapticFeaturesSafe, SDL3.Sys.Haptic.getNumHapticAxes, SDL3.Sys.Haptic.getNumHapticAxesSafe, SDL3.Sys.Haptic.hapticEffectSupported, SDL3.Sys.Haptic.hapticEffectSupportedSafe, SDL3.Sys.Haptic.createHapticEffect, SDL3.Sys.Haptic.createHapticEffectSafe, SDL3.Sys.Haptic.updateHapticEffect, SDL3.Sys.Haptic.updateHapticEffectSafe, SDL3.Sys.Haptic.runHapticEffect, SDL3.Sys.Haptic.runHapticEffectSafe, SDL3.Sys.Haptic.stopHapticEffect, SDL3.Sys.Haptic.stopHapticEffectSafe, SDL3.Sys.Haptic.destroyHapticEffect, SDL3.Sys.Haptic.destroyHapticEffectSafe, SDL3.Sys.Haptic.getHapticEffectStatus, SDL3.Sys.Haptic.getHapticEffectStatusSafe, SDL3.Sys.Haptic.setHapticGain, SDL3.Sys.Haptic.setHapticGainSafe, SDL3.Sys.Haptic.setHapticAutocenter, SDL3.Sys.Haptic.setHapticAutocenterSafe, SDL3.Sys.Haptic.pauseHaptic, SDL3.Sys.Haptic.pauseHapticSafe, SDL3.Sys.Haptic.resumeHaptic, SDL3.Sys.Haptic.resumeHapticSafe, SDL3.Sys.Haptic.stopHapticEffects, SDL3.Sys.Haptic.stopHapticEffectsSafe, SDL3.Sys.Haptic.hapticRumbleSupported, SDL3.Sys.Haptic.hapticRumbleSupportedSafe, SDL3.Sys.Haptic.initHapticRumble, SDL3.Sys.Haptic.initHapticRumbleSafe, SDL3.Sys.Haptic.playHapticRumble, SDL3.Sys.Haptic.playHapticRumbleSafe, SDL3.Sys.Haptic.stopHapticRumble, SDL3.Sys.Haptic.stopHapticRumbleSafe, ) where import Data.Coerce qualified as Coerce import Prelude (Bool, Float, IO, fmap) import HsBindgen.Runtime.CBool qualified as CBool import HsBindgen.Runtime.LibC qualified import HsBindgen.Runtime.PtrConst qualified as PtrConst import HsBindgen.Runtime.Support qualified as BG import SDL3.Sys.Bindgen.Haptic import SDL3.Sys.Bindgen.Haptic.Safe qualified as Safe import SDL3.Sys.Bindgen.Haptic.Unsafe qualified as Unsafe import SDL3.Sys.Bindgen.Joystick qualified import SDL3.Sys.Bindgen.Stdinc qualified -- | Get a list of currently connected haptic devices. -- -- [Returns]: a 0 terminated array of haptic device instance IDs or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. This should be freed with 'SDL3.Sys.Stdinc.free' when it is no longer needed. -- -- @since 3.2.0 -- -- [See also]: 'openHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetHaptics@. -- The safe flavor is 'getHapticsSafe' -- . -- -- [C declaration]: @SDL_GetHaptics@, defined at @SDL3\/SDL_haptic.h 975:44@ getHaptics :: BG.Ptr BG.CInt -- ^ -- -- [@count@]: a pointer filled in with the number of haptic devices returned, may be NULL. -> IO (BG.Ptr SDL_HapticID) getHaptics :: Ptr CInt -> IO (Ptr SDL_HapticID) getHaptics = Ptr CInt -> IO (Ptr SDL_HapticID) Unsafe.sDL_GetHaptics -- | Get a list of currently connected haptic devices. -- -- [Returns]: a 0 terminated array of haptic device instance IDs or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. This should be freed with 'SDL3.Sys.Stdinc.free' when it is no longer needed. -- -- @since 3.2.0 -- -- [See also]: 'openHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetHaptics@. -- The unsafe flavor is 'getHaptics' -- . -- -- [C declaration]: @SDL_GetHaptics@, defined at @SDL3\/SDL_haptic.h 975:44@ getHapticsSafe :: BG.Ptr BG.CInt -- ^ -- -- [@count@]: a pointer filled in with the number of haptic devices returned, may be NULL. -> IO (BG.Ptr SDL_HapticID) getHapticsSafe :: Ptr CInt -> IO (Ptr SDL_HapticID) getHapticsSafe = Ptr CInt -> IO (Ptr SDL_HapticID) Safe.sDL_GetHaptics -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getHapticName', 'openHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetHapticNameForID@. -- The safe flavor is 'getHapticNameForIDSafe' -- . -- -- [C declaration]: @SDL_GetHapticNameForID@, defined at @SDL3\/SDL_haptic.h 992:42@ getHapticNameForID :: SDL_HapticID -- ^ -- -- [@instance_id@]: the haptic device instance ID. -> IO (PtrConst.PtrConst BG.CChar) getHapticNameForID :: SDL_HapticID -> IO (PtrConst CChar) getHapticNameForID = SDL_HapticID -> IO (PtrConst CChar) Unsafe.sDL_GetHapticNameForID -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getHapticName', 'openHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetHapticNameForID@. -- The unsafe flavor is 'getHapticNameForID' -- . -- -- [C declaration]: @SDL_GetHapticNameForID@, defined at @SDL3\/SDL_haptic.h 992:42@ getHapticNameForIDSafe :: SDL_HapticID -- ^ -- -- [@instance_id@]: the haptic device instance ID. -> IO (PtrConst.PtrConst BG.CChar) getHapticNameForIDSafe :: SDL_HapticID -> IO (PtrConst CChar) getHapticNameForIDSafe = SDL_HapticID -> IO (PtrConst CChar) Safe.sDL_GetHapticNameForID -- | 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 @'setHapticGain'@ and @'setHapticAutocenter'@. -- -- [Returns]: the device identifier or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'closeHaptic', 'getHaptics', 'openHapticFromJoystick', 'openHapticFromMouse', 'setHapticAutocenter', 'setHapticGain' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_OpenHaptic@. -- The safe flavor is 'openHapticSafe' -- . -- -- [C declaration]: @SDL_OpenHaptic@, defined at @SDL3\/SDL_haptic.h 1017:42@ openHaptic :: SDL_HapticID -- ^ -- -- [@instance_id@]: the haptic device instance ID. -> IO (BG.Ptr SDL_Haptic) openHaptic :: SDL_HapticID -> IO (Ptr SDL_Haptic) openHaptic = SDL_HapticID -> IO (Ptr SDL_Haptic) Unsafe.sDL_OpenHaptic -- | 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 @'setHapticGain'@ and @'setHapticAutocenter'@. -- -- [Returns]: the device identifier or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'closeHaptic', 'getHaptics', 'openHapticFromJoystick', 'openHapticFromMouse', 'setHapticAutocenter', 'setHapticGain' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_OpenHaptic@. -- The unsafe flavor is 'openHaptic' -- . -- -- [C declaration]: @SDL_OpenHaptic@, defined at @SDL3\/SDL_haptic.h 1017:42@ openHapticSafe :: SDL_HapticID -- ^ -- -- [@instance_id@]: the haptic device instance ID. -> IO (BG.Ptr SDL_Haptic) openHapticSafe :: SDL_HapticID -> IO (Ptr SDL_Haptic) openHapticSafe = SDL_HapticID -> IO (Ptr SDL_Haptic) Safe.sDL_OpenHaptic -- | Get the 'SDL_Haptic' associated with an instance ID, if it has been opened. -- -- [Returns]: an 'SDL_Haptic' on success or NULL on failure or if it hasn\'t been opened yet; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetHapticFromID@. -- The safe flavor is 'getHapticFromIDSafe' -- . -- -- [C declaration]: @SDL_GetHapticFromID@, defined at @SDL3\/SDL_haptic.h 1029:42@ getHapticFromID :: SDL_HapticID -- ^ -- -- [@instance_id@]: the instance ID to get the 'SDL_Haptic' for. -> IO (BG.Ptr SDL_Haptic) getHapticFromID :: SDL_HapticID -> IO (Ptr SDL_Haptic) getHapticFromID = SDL_HapticID -> IO (Ptr SDL_Haptic) Unsafe.sDL_GetHapticFromID -- | Get the 'SDL_Haptic' associated with an instance ID, if it has been opened. -- -- [Returns]: an 'SDL_Haptic' on success or NULL on failure or if it hasn\'t been opened yet; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetHapticFromID@. -- The unsafe flavor is 'getHapticFromID' -- . -- -- [C declaration]: @SDL_GetHapticFromID@, defined at @SDL3\/SDL_haptic.h 1029:42@ getHapticFromIDSafe :: SDL_HapticID -- ^ -- -- [@instance_id@]: the instance ID to get the 'SDL_Haptic' for. -> IO (BG.Ptr SDL_Haptic) getHapticFromIDSafe :: SDL_HapticID -> IO (Ptr SDL_Haptic) getHapticFromIDSafe = SDL_HapticID -> IO (Ptr SDL_Haptic) Safe.sDL_GetHapticFromID -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetHapticID@. -- The safe flavor is 'getHapticIDSafe' -- . -- -- [C declaration]: @SDL_GetHapticID@, defined at @SDL3\/SDL_haptic.h 1040:42@ getHapticID :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query. -> IO SDL_HapticID getHapticID :: Ptr SDL_Haptic -> IO SDL_HapticID getHapticID = Ptr SDL_Haptic -> IO SDL_HapticID Unsafe.sDL_GetHapticID -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetHapticID@. -- The unsafe flavor is 'getHapticID' -- . -- -- [C declaration]: @SDL_GetHapticID@, defined at @SDL3\/SDL_haptic.h 1040:42@ getHapticIDSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query. -> IO SDL_HapticID getHapticIDSafe :: Ptr SDL_Haptic -> IO SDL_HapticID getHapticIDSafe = Ptr SDL_Haptic -> IO SDL_HapticID Safe.sDL_GetHapticID -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getHapticNameForID' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetHapticName@. -- The safe flavor is 'getHapticNameSafe' -- . -- -- [C declaration]: @SDL_GetHapticName@, defined at @SDL3\/SDL_haptic.h 1054:42@ getHapticName :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' obtained from 'SDL3.Sys.Joystick.openJoystick'. -> IO (PtrConst.PtrConst BG.CChar) getHapticName :: Ptr SDL_Haptic -> IO (PtrConst CChar) getHapticName = Ptr SDL_Haptic -> IO (PtrConst CChar) Unsafe.sDL_GetHapticName -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getHapticNameForID' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetHapticName@. -- The unsafe flavor is 'getHapticName' -- . -- -- [C declaration]: @SDL_GetHapticName@, defined at @SDL3\/SDL_haptic.h 1054:42@ getHapticNameSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' obtained from 'SDL3.Sys.Joystick.openJoystick'. -> IO (PtrConst.PtrConst BG.CChar) getHapticNameSafe :: Ptr SDL_Haptic -> IO (PtrConst CChar) getHapticNameSafe = Ptr SDL_Haptic -> IO (PtrConst CChar) Safe.sDL_GetHapticName -- | Query whether or not the current mouse has haptic capabilities. -- -- [Returns]: true if the mouse is haptic or false if it isn\'t. -- -- @since 3.2.0 -- -- [See also]: 'openHapticFromMouse' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_IsMouseHaptic@. -- The safe flavor is 'isMouseHapticSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_IsMouseHaptic@, defined at @SDL3\/SDL_haptic.h 1065:34@ isMouseHaptic :: IO Bool isMouseHaptic :: IO Bool isMouseHaptic = (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool IO CBool Unsafe.sDL_IsMouseHaptic -- | Query whether or not the current mouse has haptic capabilities. -- -- [Returns]: true if the mouse is haptic or false if it isn\'t. -- -- @since 3.2.0 -- -- [See also]: 'openHapticFromMouse' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_IsMouseHaptic@. -- The unsafe flavor is 'isMouseHaptic' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_IsMouseHaptic@, defined at @SDL3\/SDL_haptic.h 1065:34@ isMouseHapticSafe :: IO Bool isMouseHapticSafe :: IO Bool isMouseHapticSafe = (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool IO CBool Safe.sDL_IsMouseHaptic -- | Try to open a haptic device from the current mouse. -- -- [Returns]: the haptic device identifier or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'closeHaptic', 'isMouseHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_OpenHapticFromMouse@. -- The safe flavor is 'openHapticFromMouseSafe' -- . -- -- [C declaration]: @SDL_OpenHapticFromMouse@, defined at @SDL3\/SDL_haptic.h 1078:42@ openHapticFromMouse :: IO (BG.Ptr SDL_Haptic) openHapticFromMouse :: IO (Ptr SDL_Haptic) openHapticFromMouse = IO (Ptr SDL_Haptic) Unsafe.sDL_OpenHapticFromMouse -- | Try to open a haptic device from the current mouse. -- -- [Returns]: the haptic device identifier or NULL on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'closeHaptic', 'isMouseHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_OpenHapticFromMouse@. -- The unsafe flavor is 'openHapticFromMouse' -- . -- -- [C declaration]: @SDL_OpenHapticFromMouse@, defined at @SDL3\/SDL_haptic.h 1078:42@ openHapticFromMouseSafe :: IO (BG.Ptr SDL_Haptic) openHapticFromMouseSafe :: IO (Ptr SDL_Haptic) openHapticFromMouseSafe = IO (Ptr SDL_Haptic) Safe.sDL_OpenHapticFromMouse -- | Query if a joystick has haptic features. -- -- [Returns]: true if the joystick is haptic or false if it isn\'t. -- -- @since 3.2.0 -- -- [See also]: 'openHapticFromJoystick' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_IsJoystickHaptic@. -- The safe flavor is 'isJoystickHapticSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_IsJoystickHaptic@, defined at @SDL3\/SDL_haptic.h 1090:34@ isJoystickHaptic :: BG.Ptr SDL3.Sys.Bindgen.Joystick.SDL_Joystick -- ^ -- -- [@joystick@]: the SDL_Joystick to test for haptic capabilities. -> IO Bool isJoystickHaptic :: Ptr SDL_Joystick -> IO Bool isJoystickHaptic = \Ptr SDL_Joystick x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Joystick -> IO CBool Unsafe.sDL_IsJoystickHaptic Ptr SDL_Joystick x00) -- | Query if a joystick has haptic features. -- -- [Returns]: true if the joystick is haptic or false if it isn\'t. -- -- @since 3.2.0 -- -- [See also]: 'openHapticFromJoystick' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_IsJoystickHaptic@. -- The unsafe flavor is 'isJoystickHaptic' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_IsJoystickHaptic@, defined at @SDL3\/SDL_haptic.h 1090:34@ isJoystickHapticSafe :: BG.Ptr SDL3.Sys.Bindgen.Joystick.SDL_Joystick -- ^ -- -- [@joystick@]: the SDL_Joystick to test for haptic capabilities. -> IO Bool isJoystickHapticSafe :: Ptr SDL_Joystick -> IO Bool isJoystickHapticSafe = \Ptr SDL_Joystick x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Joystick -> IO CBool Safe.sDL_IsJoystickHaptic Ptr SDL_Joystick x00) -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'closeHaptic', 'isJoystickHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_OpenHapticFromJoystick@. -- The safe flavor is 'openHapticFromJoystickSafe' -- . -- -- [C declaration]: @SDL_OpenHapticFromJoystick@, defined at @SDL3\/SDL_haptic.h 1112:42@ openHapticFromJoystick :: BG.Ptr SDL3.Sys.Bindgen.Joystick.SDL_Joystick -- ^ -- -- [@joystick@]: the SDL_Joystick to create a haptic device from. -> IO (BG.Ptr SDL_Haptic) openHapticFromJoystick :: Ptr SDL_Joystick -> IO (Ptr SDL_Haptic) openHapticFromJoystick = Ptr SDL_Joystick -> IO (Ptr SDL_Haptic) Unsafe.sDL_OpenHapticFromJoystick -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'closeHaptic', 'isJoystickHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_OpenHapticFromJoystick@. -- The unsafe flavor is 'openHapticFromJoystick' -- . -- -- [C declaration]: @SDL_OpenHapticFromJoystick@, defined at @SDL3\/SDL_haptic.h 1112:42@ openHapticFromJoystickSafe :: BG.Ptr SDL3.Sys.Bindgen.Joystick.SDL_Joystick -- ^ -- -- [@joystick@]: the SDL_Joystick to create a haptic device from. -> IO (BG.Ptr SDL_Haptic) openHapticFromJoystickSafe :: Ptr SDL_Joystick -> IO (Ptr SDL_Haptic) openHapticFromJoystickSafe = Ptr SDL_Joystick -> IO (Ptr SDL_Haptic) Safe.sDL_OpenHapticFromJoystick -- | Close a haptic device previously opened with @'openHaptic'@. -- -- @since 3.2.0 -- -- [See also]: 'openHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_CloseHaptic@. -- The safe flavor is 'closeHapticSafe' -- . -- -- [C declaration]: @SDL_CloseHaptic@, defined at @SDL3\/SDL_haptic.h 1123:34@ closeHaptic :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to close. -> IO () closeHaptic :: Ptr SDL_Haptic -> IO () closeHaptic = Ptr SDL_Haptic -> IO () Unsafe.sDL_CloseHaptic -- | Close a haptic device previously opened with @'openHaptic'@. -- -- @since 3.2.0 -- -- [See also]: 'openHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_CloseHaptic@. -- The unsafe flavor is 'closeHaptic' -- . -- -- [C declaration]: @SDL_CloseHaptic@, defined at @SDL3\/SDL_haptic.h 1123:34@ closeHapticSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to close. -> IO () closeHapticSafe :: Ptr SDL_Haptic -> IO () closeHapticSafe = Ptr SDL_Haptic -> IO () Safe.sDL_CloseHaptic -- | 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 @'getMaxHapticEffects'@. -- -- [Returns]: the number of effects the haptic device can store or a negative error code on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getMaxHapticEffectsPlaying', 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetMaxHapticEffects@. -- The safe flavor is 'getMaxHapticEffectsSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetMaxHapticEffects@, defined at @SDL3\/SDL_haptic.h 1141:33@ getMaxHapticEffects :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query. -> IO BG.Int32 getMaxHapticEffects :: Ptr SDL_Haptic -> IO Int32 getMaxHapticEffects = \Ptr SDL_Haptic x00 -> (CInt -> Int32) -> IO CInt -> IO Int32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CInt -> Int32 forall a b. Coercible a b => a -> b Coerce.coerce (Ptr SDL_Haptic -> IO CInt Unsafe.sDL_GetMaxHapticEffects Ptr SDL_Haptic x00) -- | 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 @'getMaxHapticEffects'@. -- -- [Returns]: the number of effects the haptic device can store or a negative error code on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getMaxHapticEffectsPlaying', 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetMaxHapticEffects@. -- The unsafe flavor is 'getMaxHapticEffects' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetMaxHapticEffects@, defined at @SDL3\/SDL_haptic.h 1141:33@ getMaxHapticEffectsSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query. -> IO BG.Int32 getMaxHapticEffectsSafe :: Ptr SDL_Haptic -> IO Int32 getMaxHapticEffectsSafe = \Ptr SDL_Haptic x00 -> (CInt -> Int32) -> IO CInt -> IO Int32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CInt -> Int32 forall a b. Coercible a b => a -> b Coerce.coerce (Ptr SDL_Haptic -> IO CInt Safe.sDL_GetMaxHapticEffects Ptr SDL_Haptic x00) -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getMaxHapticEffects', 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetMaxHapticEffectsPlaying@. -- The safe flavor is 'getMaxHapticEffectsPlayingSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetMaxHapticEffectsPlaying@, defined at @SDL3\/SDL_haptic.h 1157:33@ getMaxHapticEffectsPlaying :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query maximum playing effects. -> IO BG.Int32 getMaxHapticEffectsPlaying :: Ptr SDL_Haptic -> IO Int32 getMaxHapticEffectsPlaying = \Ptr SDL_Haptic x00 -> (CInt -> Int32) -> IO CInt -> IO Int32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CInt -> Int32 forall a b. Coercible a b => a -> b Coerce.coerce (Ptr SDL_Haptic -> IO CInt Unsafe.sDL_GetMaxHapticEffectsPlaying Ptr SDL_Haptic x00) -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getMaxHapticEffects', 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetMaxHapticEffectsPlaying@. -- The unsafe flavor is 'getMaxHapticEffectsPlaying' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetMaxHapticEffectsPlaying@, defined at @SDL3\/SDL_haptic.h 1157:33@ getMaxHapticEffectsPlayingSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query maximum playing effects. -> IO BG.Int32 getMaxHapticEffectsPlayingSafe :: Ptr SDL_Haptic -> IO Int32 getMaxHapticEffectsPlayingSafe = \Ptr SDL_Haptic x00 -> (CInt -> Int32) -> IO CInt -> IO Int32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CInt -> Int32 forall a b. Coercible a b => a -> b Coerce.coerce (Ptr SDL_Haptic -> IO CInt Safe.sDL_GetMaxHapticEffectsPlaying Ptr SDL_Haptic x00) -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'hapticEffectSupported', 'getMaxHapticEffects' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetHapticFeatures@. -- The safe flavor is 'getHapticFeaturesSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetHapticFeatures@, defined at @SDL3\/SDL_haptic.h 1171:36@ getHapticFeatures :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query. -> IO BG.Word32 getHapticFeatures :: Ptr SDL_Haptic -> IO Word32 getHapticFeatures = \Ptr SDL_Haptic x00 -> (Uint32 -> Word32) -> IO Uint32 -> IO Word32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap Uint32 -> Word32 forall a b. Coercible a b => a -> b Coerce.coerce (Ptr SDL_Haptic -> IO Uint32 Unsafe.sDL_GetHapticFeatures Ptr SDL_Haptic x00) -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'hapticEffectSupported', 'getMaxHapticEffects' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetHapticFeatures@. -- The unsafe flavor is 'getHapticFeatures' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetHapticFeatures@, defined at @SDL3\/SDL_haptic.h 1171:36@ getHapticFeaturesSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query. -> IO BG.Word32 getHapticFeaturesSafe :: Ptr SDL_Haptic -> IO Word32 getHapticFeaturesSafe = \Ptr SDL_Haptic x00 -> (Uint32 -> Word32) -> IO Uint32 -> IO Word32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap Uint32 -> Word32 forall a b. Coercible a b => a -> b Coerce.coerce (Ptr SDL_Haptic -> IO Uint32 Safe.sDL_GetHapticFeatures Ptr SDL_Haptic x00) -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetNumHapticAxes@. -- The safe flavor is 'getNumHapticAxesSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetNumHapticAxes@, defined at @SDL3\/SDL_haptic.h 1185:33@ getNumHapticAxes :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query. -> IO BG.Int32 getNumHapticAxes :: Ptr SDL_Haptic -> IO Int32 getNumHapticAxes = \Ptr SDL_Haptic x00 -> (CInt -> Int32) -> IO CInt -> IO Int32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CInt -> Int32 forall a b. Coercible a b => a -> b Coerce.coerce (Ptr SDL_Haptic -> IO CInt Unsafe.sDL_GetNumHapticAxes Ptr SDL_Haptic x00) -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetNumHapticAxes@. -- The unsafe flavor is 'getNumHapticAxes' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetNumHapticAxes@, defined at @SDL3\/SDL_haptic.h 1185:33@ getNumHapticAxesSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query. -> IO BG.Int32 getNumHapticAxesSafe :: Ptr SDL_Haptic -> IO Int32 getNumHapticAxesSafe = \Ptr SDL_Haptic x00 -> (CInt -> Int32) -> IO CInt -> IO Int32 forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CInt -> Int32 forall a b. Coercible a b => a -> b Coerce.coerce (Ptr SDL_Haptic -> IO CInt Safe.sDL_GetNumHapticAxes Ptr SDL_Haptic x00) -- | 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. -- -- @since 3.2.0 -- -- [See also]: 'createHapticEffect', 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_HapticEffectSupported@. -- The safe flavor is 'hapticEffectSupportedSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_HapticEffectSupported@, defined at @SDL3\/SDL_haptic.h 1199:34@ hapticEffectSupported :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query. -> PtrConst.PtrConst SDL_HapticEffect -- ^ -- -- [@effect@]: the desired effect to query. -> IO Bool hapticEffectSupported :: Ptr SDL_Haptic -> PtrConst SDL_HapticEffect -> IO Bool hapticEffectSupported = \Ptr SDL_Haptic x00 -> \PtrConst SDL_HapticEffect x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> PtrConst SDL_HapticEffect -> IO CBool Unsafe.sDL_HapticEffectSupported Ptr SDL_Haptic x00 PtrConst SDL_HapticEffect x11) -- | 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. -- -- @since 3.2.0 -- -- [See also]: 'createHapticEffect', 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_HapticEffectSupported@. -- The unsafe flavor is 'hapticEffectSupported' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_HapticEffectSupported@, defined at @SDL3\/SDL_haptic.h 1199:34@ hapticEffectSupportedSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query. -> PtrConst.PtrConst SDL_HapticEffect -- ^ -- -- [@effect@]: the desired effect to query. -> IO Bool hapticEffectSupportedSafe :: Ptr SDL_Haptic -> PtrConst SDL_HapticEffect -> IO Bool hapticEffectSupportedSafe = \Ptr SDL_Haptic x00 -> \PtrConst SDL_HapticEffect x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> PtrConst SDL_HapticEffect -> IO CBool Safe.sDL_HapticEffectSupported Ptr SDL_Haptic x00 PtrConst SDL_HapticEffect x11) -- | Create a new haptic effect on a specified device. -- -- [Returns]: the ID of the effect on success or -1 on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'destroyHapticEffect', 'runHapticEffect', 'updateHapticEffect' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_CreateHapticEffect@. -- The safe flavor is 'createHapticEffectSafe' -- . -- -- [C declaration]: @SDL_CreateHapticEffect@, defined at @SDL3\/SDL_haptic.h 1216:48@ createHapticEffect :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: an 'SDL_Haptic' device to create the effect on. -> PtrConst.PtrConst SDL_HapticEffect -- ^ -- -- [@effect@]: an 'SDL_HapticEffect' structure containing the properties of the effect to create. -> IO SDL_HapticEffectID createHapticEffect :: Ptr SDL_Haptic -> PtrConst SDL_HapticEffect -> IO SDL_HapticEffectID createHapticEffect = Ptr SDL_Haptic -> PtrConst SDL_HapticEffect -> IO SDL_HapticEffectID Unsafe.sDL_CreateHapticEffect -- | Create a new haptic effect on a specified device. -- -- [Returns]: the ID of the effect on success or -1 on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'destroyHapticEffect', 'runHapticEffect', 'updateHapticEffect' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_CreateHapticEffect@. -- The unsafe flavor is 'createHapticEffect' -- . -- -- [C declaration]: @SDL_CreateHapticEffect@, defined at @SDL3\/SDL_haptic.h 1216:48@ createHapticEffectSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: an 'SDL_Haptic' device to create the effect on. -> PtrConst.PtrConst SDL_HapticEffect -- ^ -- -- [@effect@]: an 'SDL_HapticEffect' structure containing the properties of the effect to create. -> IO SDL_HapticEffectID createHapticEffectSafe :: Ptr SDL_Haptic -> PtrConst SDL_HapticEffect -> IO SDL_HapticEffectID createHapticEffectSafe = Ptr SDL_Haptic -> PtrConst SDL_HapticEffect -> IO SDL_HapticEffectID Safe.sDL_CreateHapticEffect -- | 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 @'updateHapticEffect'@. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'createHapticEffect', 'runHapticEffect' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_UpdateHapticEffect@. -- The safe flavor is 'updateHapticEffectSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_UpdateHapticEffect@, defined at @SDL3\/SDL_haptic.h 1238:34@ updateHapticEffect :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device that has the effect. -> SDL_HapticEffectID -- ^ -- -- [@effect@]: the identifier of the effect to update. -> PtrConst.PtrConst SDL_HapticEffect -- ^ -- -- [@data@]: an 'SDL_HapticEffect' structure containing the new effect properties to use. -> IO Bool updateHapticEffect :: Ptr SDL_Haptic -> SDL_HapticEffectID -> PtrConst SDL_HapticEffect -> IO Bool updateHapticEffect = \Ptr SDL_Haptic x00 -> \SDL_HapticEffectID x11 -> \PtrConst SDL_HapticEffect x22 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> SDL_HapticEffectID -> PtrConst SDL_HapticEffect -> IO CBool Unsafe.sDL_UpdateHapticEffect Ptr SDL_Haptic x00 SDL_HapticEffectID x11 PtrConst SDL_HapticEffect x22) -- | 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 @'updateHapticEffect'@. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'createHapticEffect', 'runHapticEffect' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_UpdateHapticEffect@. -- The unsafe flavor is 'updateHapticEffect' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_UpdateHapticEffect@, defined at @SDL3\/SDL_haptic.h 1238:34@ updateHapticEffectSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device that has the effect. -> SDL_HapticEffectID -- ^ -- -- [@effect@]: the identifier of the effect to update. -> PtrConst.PtrConst SDL_HapticEffect -- ^ -- -- [@data@]: an 'SDL_HapticEffect' structure containing the new effect properties to use. -> IO Bool updateHapticEffectSafe :: Ptr SDL_Haptic -> SDL_HapticEffectID -> PtrConst SDL_HapticEffect -> IO Bool updateHapticEffectSafe = \Ptr SDL_Haptic x00 -> \SDL_HapticEffectID x11 -> \PtrConst SDL_HapticEffect x22 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> SDL_HapticEffectID -> PtrConst SDL_HapticEffect -> IO CBool Safe.sDL_UpdateHapticEffect Ptr SDL_Haptic x00 SDL_HapticEffectID x11 PtrConst SDL_HapticEffect x22) -- | Run the haptic effect on its associated haptic device. -- -- To repeat the effect over and over indefinitely, set @iterations@ to @'sDL_HAPTIC_INFINITY'@. (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 @length@ in its structure\/union to @'sDL_HAPTIC_INFINITY'@ instead. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getHapticEffectStatus', 'stopHapticEffect', 'stopHapticEffects' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_RunHapticEffect@. -- The safe flavor is 'runHapticEffectSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_RunHapticEffect@, defined at @SDL3\/SDL_haptic.h 1262:34@ runHapticEffect :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to run the effect on. -> SDL_HapticEffectID -- ^ -- -- [@effect@]: the ID of the haptic effect to run. -> BG.Word32 -- ^ -- -- [@iterations@]: the number of iterations to run the effect; use @'sDL_HAPTIC_INFINITY'@ to repeat forever. -> IO Bool runHapticEffect :: Ptr SDL_Haptic -> SDL_HapticEffectID -> Word32 -> IO Bool runHapticEffect = \Ptr SDL_Haptic x00 -> \SDL_HapticEffectID x11 -> \Word32 x22 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> SDL_HapticEffectID -> Uint32 -> IO CBool Unsafe.sDL_RunHapticEffect Ptr SDL_Haptic x00 SDL_HapticEffectID x11 (Word32 -> Uint32 forall a b. Coercible a b => a -> b Coerce.coerce Word32 x22)) -- | Run the haptic effect on its associated haptic device. -- -- To repeat the effect over and over indefinitely, set @iterations@ to @'sDL_HAPTIC_INFINITY'@. (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 @length@ in its structure\/union to @'sDL_HAPTIC_INFINITY'@ instead. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getHapticEffectStatus', 'stopHapticEffect', 'stopHapticEffects' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_RunHapticEffect@. -- The unsafe flavor is 'runHapticEffect' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_RunHapticEffect@, defined at @SDL3\/SDL_haptic.h 1262:34@ runHapticEffectSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to run the effect on. -> SDL_HapticEffectID -- ^ -- -- [@effect@]: the ID of the haptic effect to run. -> BG.Word32 -- ^ -- -- [@iterations@]: the number of iterations to run the effect; use @'sDL_HAPTIC_INFINITY'@ to repeat forever. -> IO Bool runHapticEffectSafe :: Ptr SDL_Haptic -> SDL_HapticEffectID -> Word32 -> IO Bool runHapticEffectSafe = \Ptr SDL_Haptic x00 -> \SDL_HapticEffectID x11 -> \Word32 x22 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> SDL_HapticEffectID -> Uint32 -> IO CBool Safe.sDL_RunHapticEffect Ptr SDL_Haptic x00 SDL_HapticEffectID x11 (Word32 -> Uint32 forall a b. Coercible a b => a -> b Coerce.coerce Word32 x22)) -- | Stop the haptic effect on its associated haptic device. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'runHapticEffect', 'stopHapticEffects' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_StopHapticEffect@. -- The safe flavor is 'stopHapticEffectSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_StopHapticEffect@, defined at @SDL3\/SDL_haptic.h 1277:34@ stopHapticEffect :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to stop the effect on. -> SDL_HapticEffectID -- ^ -- -- [@effect@]: the ID of the haptic effect to stop. -> IO Bool stopHapticEffect :: Ptr SDL_Haptic -> SDL_HapticEffectID -> IO Bool stopHapticEffect = \Ptr SDL_Haptic x00 -> \SDL_HapticEffectID x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> SDL_HapticEffectID -> IO CBool Unsafe.sDL_StopHapticEffect Ptr SDL_Haptic x00 SDL_HapticEffectID x11) -- | Stop the haptic effect on its associated haptic device. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'runHapticEffect', 'stopHapticEffects' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_StopHapticEffect@. -- The unsafe flavor is 'stopHapticEffect' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_StopHapticEffect@, defined at @SDL3\/SDL_haptic.h 1277:34@ stopHapticEffectSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to stop the effect on. -> SDL_HapticEffectID -- ^ -- -- [@effect@]: the ID of the haptic effect to stop. -> IO Bool stopHapticEffectSafe :: Ptr SDL_Haptic -> SDL_HapticEffectID -> IO Bool stopHapticEffectSafe = \Ptr SDL_Haptic x00 -> \SDL_HapticEffectID x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> SDL_HapticEffectID -> IO CBool Safe.sDL_StopHapticEffect Ptr SDL_Haptic x00 SDL_HapticEffectID x11) -- | 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. -- -- @since 3.2.0 -- -- [See also]: 'createHapticEffect' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_DestroyHapticEffect@. -- The safe flavor is 'destroyHapticEffectSafe' -- . -- -- [C declaration]: @SDL_DestroyHapticEffect@, defined at @SDL3\/SDL_haptic.h 1292:34@ destroyHapticEffect :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to destroy the effect on. -> SDL_HapticEffectID -- ^ -- -- [@effect@]: the ID of the haptic effect to destroy. -> IO () destroyHapticEffect :: Ptr SDL_Haptic -> SDL_HapticEffectID -> IO () destroyHapticEffect = Ptr SDL_Haptic -> SDL_HapticEffectID -> IO () Unsafe.sDL_DestroyHapticEffect -- | 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. -- -- @since 3.2.0 -- -- [See also]: 'createHapticEffect' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_DestroyHapticEffect@. -- The unsafe flavor is 'destroyHapticEffect' -- . -- -- [C declaration]: @SDL_DestroyHapticEffect@, defined at @SDL3\/SDL_haptic.h 1292:34@ destroyHapticEffectSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to destroy the effect on. -> SDL_HapticEffectID -- ^ -- -- [@effect@]: the ID of the haptic effect to destroy. -> IO () destroyHapticEffectSafe :: Ptr SDL_Haptic -> SDL_HapticEffectID -> IO () destroyHapticEffectSafe = Ptr SDL_Haptic -> SDL_HapticEffectID -> IO () Safe.sDL_DestroyHapticEffect -- | 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. -- -- @since 3.2.0 -- -- [See also]: 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_GetHapticEffectStatus@. -- The safe flavor is 'getHapticEffectStatusSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetHapticEffectStatus@, defined at @SDL3\/SDL_haptic.h 1308:34@ getHapticEffectStatus :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query for the effect status on. -> SDL_HapticEffectID -- ^ -- -- [@effect@]: the ID of the haptic effect to query its status. -> IO Bool getHapticEffectStatus :: Ptr SDL_Haptic -> SDL_HapticEffectID -> IO Bool getHapticEffectStatus = \Ptr SDL_Haptic x00 -> \SDL_HapticEffectID x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> SDL_HapticEffectID -> IO CBool Unsafe.sDL_GetHapticEffectStatus Ptr SDL_Haptic x00 SDL_HapticEffectID x11) -- | 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. -- -- @since 3.2.0 -- -- [See also]: 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_GetHapticEffectStatus@. -- The unsafe flavor is 'getHapticEffectStatus' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_GetHapticEffectStatus@, defined at @SDL3\/SDL_haptic.h 1308:34@ getHapticEffectStatusSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to query for the effect status on. -> SDL_HapticEffectID -- ^ -- -- [@effect@]: the ID of the haptic effect to query its status. -> IO Bool getHapticEffectStatusSafe :: Ptr SDL_Haptic -> SDL_HapticEffectID -> IO Bool getHapticEffectStatusSafe = \Ptr SDL_Haptic x00 -> \SDL_HapticEffectID x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> SDL_HapticEffectID -> IO CBool Safe.sDL_GetHapticEffectStatus Ptr SDL_Haptic x00 SDL_HapticEffectID x11) -- | 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 @'setHapticGain'@ will scale linearly using @SDL_HAPTIC_GAIN_MAX@ as the maximum. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_SetHapticGain@. -- The safe flavor is 'setHapticGainSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_SetHapticGain@, defined at @SDL3\/SDL_haptic.h 1330:34@ setHapticGain :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to set the gain on. -> BG.Int32 -- ^ -- -- [@gain@]: value to set the gain to, should be between 0 and 100 (0 - 100). -> IO Bool setHapticGain :: Ptr SDL_Haptic -> Int32 -> IO Bool setHapticGain = \Ptr SDL_Haptic x00 -> \Int32 x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> CInt -> IO CBool Unsafe.sDL_SetHapticGain Ptr SDL_Haptic x00 (Int32 -> CInt forall a b. Coercible a b => a -> b Coerce.coerce Int32 x11)) -- | 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 @'setHapticGain'@ will scale linearly using @SDL_HAPTIC_GAIN_MAX@ as the maximum. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_SetHapticGain@. -- The unsafe flavor is 'setHapticGain' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_SetHapticGain@, defined at @SDL3\/SDL_haptic.h 1330:34@ setHapticGainSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to set the gain on. -> BG.Int32 -- ^ -- -- [@gain@]: value to set the gain to, should be between 0 and 100 (0 - 100). -> IO Bool setHapticGainSafe :: Ptr SDL_Haptic -> Int32 -> IO Bool setHapticGainSafe = \Ptr SDL_Haptic x00 -> \Int32 x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> CInt -> IO CBool Safe.sDL_SetHapticGain Ptr SDL_Haptic x00 (Int32 -> CInt forall a b. Coercible a b => a -> b Coerce.coerce Int32 x11)) -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_SetHapticAutocenter@. -- The safe flavor is 'setHapticAutocenterSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_SetHapticAutocenter@, defined at @SDL3\/SDL_haptic.h 1349:34@ setHapticAutocenter :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to set autocentering on. -> BG.Int32 -- ^ -- -- [@autocenter@]: value to set autocenter to (0-100). -> IO Bool setHapticAutocenter :: Ptr SDL_Haptic -> Int32 -> IO Bool setHapticAutocenter = \Ptr SDL_Haptic x00 -> \Int32 x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> CInt -> IO CBool Unsafe.sDL_SetHapticAutocenter Ptr SDL_Haptic x00 (Int32 -> CInt forall a b. Coercible a b => a -> b Coerce.coerce Int32 x11)) -- | 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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'getHapticFeatures' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_SetHapticAutocenter@. -- The unsafe flavor is 'setHapticAutocenter' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_SetHapticAutocenter@, defined at @SDL3\/SDL_haptic.h 1349:34@ setHapticAutocenterSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to set autocentering on. -> BG.Int32 -- ^ -- -- [@autocenter@]: value to set autocenter to (0-100). -> IO Bool setHapticAutocenterSafe :: Ptr SDL_Haptic -> Int32 -> IO Bool setHapticAutocenterSafe = \Ptr SDL_Haptic x00 -> \Int32 x11 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> CInt -> IO CBool Safe.sDL_SetHapticAutocenter Ptr SDL_Haptic x00 (Int32 -> CInt forall a b. Coercible a b => a -> b Coerce.coerce Int32 x11)) -- | Pause a haptic device. -- -- Device must support the @'sDL_HAPTIC_PAUSE'@ feature. Call @'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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'resumeHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_PauseHaptic@. -- The safe flavor is 'pauseHapticSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_PauseHaptic@, defined at @SDL3\/SDL_haptic.h 1368:34@ pauseHaptic :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to pause. -> IO Bool pauseHaptic :: Ptr SDL_Haptic -> IO Bool pauseHaptic = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Unsafe.sDL_PauseHaptic Ptr SDL_Haptic x00) -- | Pause a haptic device. -- -- Device must support the @'sDL_HAPTIC_PAUSE'@ feature. Call @'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 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'resumeHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_PauseHaptic@. -- The unsafe flavor is 'pauseHaptic' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_PauseHaptic@, defined at @SDL3\/SDL_haptic.h 1368:34@ pauseHapticSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to pause. -> IO Bool pauseHapticSafe :: Ptr SDL_Haptic -> IO Bool pauseHapticSafe = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Safe.sDL_PauseHaptic Ptr SDL_Haptic x00) -- | Resume a haptic device. -- -- Call to unpause after @'pauseHaptic'@. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'pauseHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_ResumeHaptic@. -- The safe flavor is 'resumeHapticSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_ResumeHaptic@, defined at @SDL3\/SDL_haptic.h 1383:34@ resumeHaptic :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to unpause. -> IO Bool resumeHaptic :: Ptr SDL_Haptic -> IO Bool resumeHaptic = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Unsafe.sDL_ResumeHaptic Ptr SDL_Haptic x00) -- | Resume a haptic device. -- -- Call to unpause after @'pauseHaptic'@. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'pauseHaptic' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_ResumeHaptic@. -- The unsafe flavor is 'resumeHaptic' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_ResumeHaptic@, defined at @SDL3\/SDL_haptic.h 1383:34@ resumeHapticSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to unpause. -> IO Bool resumeHapticSafe :: Ptr SDL_Haptic -> IO Bool resumeHapticSafe = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Safe.sDL_ResumeHaptic Ptr SDL_Haptic x00) -- | Stop all the currently playing effects on a haptic device. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'runHapticEffect', 'stopHapticEffect' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_StopHapticEffects@. -- The safe flavor is 'stopHapticEffectsSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_StopHapticEffects@, defined at @SDL3\/SDL_haptic.h 1397:34@ stopHapticEffects :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to stop. -> IO Bool stopHapticEffects :: Ptr SDL_Haptic -> IO Bool stopHapticEffects = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Unsafe.sDL_StopHapticEffects Ptr SDL_Haptic x00) -- | Stop all the currently playing effects on a haptic device. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'runHapticEffect', 'stopHapticEffect' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_StopHapticEffects@. -- The unsafe flavor is 'stopHapticEffects' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_StopHapticEffects@, defined at @SDL3\/SDL_haptic.h 1397:34@ stopHapticEffectsSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the 'SDL_Haptic' device to stop. -> IO Bool stopHapticEffectsSafe :: Ptr SDL_Haptic -> IO Bool stopHapticEffectsSafe = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Safe.sDL_StopHapticEffects Ptr SDL_Haptic x00) -- | Check whether rumble is supported on a haptic device. -- -- [Returns]: true if the effect is supported or false if it isn\'t. -- -- @since 3.2.0 -- -- [See also]: 'initHapticRumble' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_HapticRumbleSupported@. -- The safe flavor is 'hapticRumbleSupportedSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_HapticRumbleSupported@, defined at @SDL3\/SDL_haptic.h 1409:34@ hapticRumbleSupported :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: haptic device to check for rumble support. -> IO Bool hapticRumbleSupported :: Ptr SDL_Haptic -> IO Bool hapticRumbleSupported = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Unsafe.sDL_HapticRumbleSupported Ptr SDL_Haptic x00) -- | Check whether rumble is supported on a haptic device. -- -- [Returns]: true if the effect is supported or false if it isn\'t. -- -- @since 3.2.0 -- -- [See also]: 'initHapticRumble' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_HapticRumbleSupported@. -- The unsafe flavor is 'hapticRumbleSupported' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_HapticRumbleSupported@, defined at @SDL3\/SDL_haptic.h 1409:34@ hapticRumbleSupportedSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: haptic device to check for rumble support. -> IO Bool hapticRumbleSupportedSafe :: Ptr SDL_Haptic -> IO Bool hapticRumbleSupportedSafe = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Safe.sDL_HapticRumbleSupported Ptr SDL_Haptic x00) -- | Initialize a haptic device for simple rumble playback. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'playHapticRumble', 'stopHapticRumble', 'hapticRumbleSupported' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_InitHapticRumble@. -- The safe flavor is 'initHapticRumbleSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_InitHapticRumble@, defined at @SDL3\/SDL_haptic.h 1424:34@ initHapticRumble :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the haptic device to initialize for simple rumble playback. -> IO Bool initHapticRumble :: Ptr SDL_Haptic -> IO Bool initHapticRumble = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Unsafe.sDL_InitHapticRumble Ptr SDL_Haptic x00) -- | Initialize a haptic device for simple rumble playback. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'playHapticRumble', 'stopHapticRumble', 'hapticRumbleSupported' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_InitHapticRumble@. -- The unsafe flavor is 'initHapticRumble' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_InitHapticRumble@, defined at @SDL3\/SDL_haptic.h 1424:34@ initHapticRumbleSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the haptic device to initialize for simple rumble playback. -> IO Bool initHapticRumbleSafe :: Ptr SDL_Haptic -> IO Bool initHapticRumbleSafe = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Safe.sDL_InitHapticRumble Ptr SDL_Haptic x00) -- | Run a simple rumble effect on a haptic device. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'initHapticRumble', 'stopHapticRumble' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_PlayHapticRumble@. -- The safe flavor is 'playHapticRumbleSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_PlayHapticRumble@, defined at @SDL3\/SDL_haptic.h 1440:34@ playHapticRumble :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the haptic device to play the rumble effect on. -> Float -- ^ -- -- [@strength@]: strength of the rumble to play as a 0-1 float value. -> BG.Word32 -- ^ -- -- [@length@]: length of the rumble to play in milliseconds. -> IO Bool playHapticRumble :: Ptr SDL_Haptic -> Float -> Word32 -> IO Bool playHapticRumble = \Ptr SDL_Haptic x00 -> \Float x11 -> \Word32 x22 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> CFloat -> Uint32 -> IO CBool Unsafe.sDL_PlayHapticRumble Ptr SDL_Haptic x00 (Float -> CFloat forall a b. Coercible a b => a -> b Coerce.coerce Float x11) (Word32 -> Uint32 forall a b. Coercible a b => a -> b Coerce.coerce Word32 x22)) -- | Run a simple rumble effect on a haptic device. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'initHapticRumble', 'stopHapticRumble' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_PlayHapticRumble@. -- The unsafe flavor is 'playHapticRumble' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_PlayHapticRumble@, defined at @SDL3\/SDL_haptic.h 1440:34@ playHapticRumbleSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the haptic device to play the rumble effect on. -> Float -- ^ -- -- [@strength@]: strength of the rumble to play as a 0-1 float value. -> BG.Word32 -- ^ -- -- [@length@]: length of the rumble to play in milliseconds. -> IO Bool playHapticRumbleSafe :: Ptr SDL_Haptic -> Float -> Word32 -> IO Bool playHapticRumbleSafe = \Ptr SDL_Haptic x00 -> \Float x11 -> \Word32 x22 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> CFloat -> Uint32 -> IO CBool Safe.sDL_PlayHapticRumble Ptr SDL_Haptic x00 (Float -> CFloat forall a b. Coercible a b => a -> b Coerce.coerce Float x11) (Word32 -> Uint32 forall a b. Coercible a b => a -> b Coerce.coerce Word32 x22)) -- | Stop the simple rumble on a haptic device. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'playHapticRumble' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Unsafe__ foreign import of @SDL_StopHapticRumble@. -- The safe flavor is 'stopHapticRumbleSafe' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_StopHapticRumble@, defined at @SDL3\/SDL_haptic.h 1453:34@ stopHapticRumble :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the haptic device to stop the rumble effect on. -> IO Bool stopHapticRumble :: Ptr SDL_Haptic -> IO Bool stopHapticRumble = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Unsafe.sDL_StopHapticRumble Ptr SDL_Haptic x00) -- | Stop the simple rumble on a haptic device. -- -- [Returns]: true on success or false on failure; call 'SDL3.Sys.Error.getError' for more information. -- -- @since 3.2.0 -- -- [See also]: 'playHapticRumble' -- -- === __@sdl3-bindgen-sys@ notes__ -- -- [FFI safety]: __Safe__ foreign import of @SDL_StopHapticRumble@. -- The unsafe flavor is 'stopHapticRumble' -- . -- -- [Scalars]: The binding generation has mapped C scalars to native Haskell scalars for this function. -- Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate. -- -- [C declaration]: @SDL_StopHapticRumble@, defined at @SDL3\/SDL_haptic.h 1453:34@ stopHapticRumbleSafe :: BG.Ptr SDL_Haptic -- ^ -- -- [@haptic@]: the haptic device to stop the rumble effect on. -> IO Bool stopHapticRumbleSafe :: Ptr SDL_Haptic -> IO Bool stopHapticRumbleSafe = \Ptr SDL_Haptic x00 -> (CBool -> Bool) -> IO CBool -> IO Bool forall a b. (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap CBool -> Bool forall b. (Eq b, Num b) => b -> Bool CBool.toBool (Ptr SDL_Haptic -> IO CBool Safe.sDL_StopHapticRumble Ptr SDL_Haptic x00) -- | Typed constant for macro @SDL_HAPTIC_POLAR@. pattern SDL_HAPTIC_POLAR :: SDL_HapticDirectionType pattern $mSDL_HAPTIC_POLAR :: forall {r}. SDL_HapticDirectionType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_POLAR :: SDL_HapticDirectionType SDL_HAPTIC_POLAR = SDL_HapticDirectionType 0 -- | Typed constant for macro @SDL_HAPTIC_CARTESIAN@. pattern SDL_HAPTIC_CARTESIAN :: SDL_HapticDirectionType pattern $mSDL_HAPTIC_CARTESIAN :: forall {r}. SDL_HapticDirectionType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_CARTESIAN :: SDL_HapticDirectionType SDL_HAPTIC_CARTESIAN = SDL_HapticDirectionType 1 -- | Typed constant for macro @SDL_HAPTIC_SPHERICAL@. pattern SDL_HAPTIC_SPHERICAL :: SDL_HapticDirectionType pattern $mSDL_HAPTIC_SPHERICAL :: forall {r}. SDL_HapticDirectionType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_SPHERICAL :: SDL_HapticDirectionType SDL_HAPTIC_SPHERICAL = SDL_HapticDirectionType 2 -- | Typed constant for macro @SDL_HAPTIC_STEERING_AXIS@. pattern SDL_HAPTIC_STEERING_AXIS :: SDL_HapticDirectionType pattern $mSDL_HAPTIC_STEERING_AXIS :: forall {r}. SDL_HapticDirectionType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_STEERING_AXIS :: SDL_HapticDirectionType SDL_HAPTIC_STEERING_AXIS = SDL_HapticDirectionType 3 -- | Typed constant for macro @SDL_HAPTIC_CONSTANT@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_CONSTANT :: SDL_HapticEffectType pattern $mSDL_HAPTIC_CONSTANT :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_CONSTANT :: SDL_HapticEffectType SDL_HAPTIC_CONSTANT = SDL_HapticEffectType 0x0001 -- | Typed constant for macro @SDL_HAPTIC_SINE@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_SINE :: SDL_HapticEffectType pattern $mSDL_HAPTIC_SINE :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_SINE :: SDL_HapticEffectType SDL_HAPTIC_SINE = SDL_HapticEffectType 0x0002 -- | Typed constant for macro @SDL_HAPTIC_SQUARE@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_SQUARE :: SDL_HapticEffectType pattern $mSDL_HAPTIC_SQUARE :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_SQUARE :: SDL_HapticEffectType SDL_HAPTIC_SQUARE = SDL_HapticEffectType 0x0004 -- | Typed constant for macro @SDL_HAPTIC_TRIANGLE@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_TRIANGLE :: SDL_HapticEffectType pattern $mSDL_HAPTIC_TRIANGLE :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_TRIANGLE :: SDL_HapticEffectType SDL_HAPTIC_TRIANGLE = SDL_HapticEffectType 0x0008 -- | Typed constant for macro @SDL_HAPTIC_SAWTOOTHUP@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_SAWTOOTHUP :: SDL_HapticEffectType pattern $mSDL_HAPTIC_SAWTOOTHUP :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_SAWTOOTHUP :: SDL_HapticEffectType SDL_HAPTIC_SAWTOOTHUP = SDL_HapticEffectType 0x0010 -- | Typed constant for macro @SDL_HAPTIC_SAWTOOTHDOWN@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_SAWTOOTHDOWN :: SDL_HapticEffectType pattern $mSDL_HAPTIC_SAWTOOTHDOWN :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_SAWTOOTHDOWN :: SDL_HapticEffectType SDL_HAPTIC_SAWTOOTHDOWN = SDL_HapticEffectType 0x0020 -- | Typed constant for macro @SDL_HAPTIC_RAMP@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_RAMP :: SDL_HapticEffectType pattern $mSDL_HAPTIC_RAMP :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_RAMP :: SDL_HapticEffectType SDL_HAPTIC_RAMP = SDL_HapticEffectType 0x0040 -- | Typed constant for macro @SDL_HAPTIC_SPRING@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_SPRING :: SDL_HapticEffectType pattern $mSDL_HAPTIC_SPRING :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_SPRING :: SDL_HapticEffectType SDL_HAPTIC_SPRING = SDL_HapticEffectType 0x0080 -- | Typed constant for macro @SDL_HAPTIC_DAMPER@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_DAMPER :: SDL_HapticEffectType pattern $mSDL_HAPTIC_DAMPER :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_DAMPER :: SDL_HapticEffectType SDL_HAPTIC_DAMPER = SDL_HapticEffectType 0x0100 -- | Typed constant for macro @SDL_HAPTIC_INERTIA@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_INERTIA :: SDL_HapticEffectType pattern $mSDL_HAPTIC_INERTIA :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_INERTIA :: SDL_HapticEffectType SDL_HAPTIC_INERTIA = SDL_HapticEffectType 0x0200 -- | Typed constant for macro @SDL_HAPTIC_FRICTION@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_FRICTION :: SDL_HapticEffectType pattern $mSDL_HAPTIC_FRICTION :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_FRICTION :: SDL_HapticEffectType SDL_HAPTIC_FRICTION = SDL_HapticEffectType 0x0400 -- | Typed constant for macro @SDL_HAPTIC_LEFTRIGHT@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_LEFTRIGHT :: SDL_HapticEffectType pattern $mSDL_HAPTIC_LEFTRIGHT :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_LEFTRIGHT :: SDL_HapticEffectType SDL_HAPTIC_LEFTRIGHT = SDL_HapticEffectType 0x0800 -- | Typed constant for macro @SDL_HAPTIC_RESERVED1@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_RESERVED1 :: SDL_HapticEffectType pattern $mSDL_HAPTIC_RESERVED1 :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_RESERVED1 :: SDL_HapticEffectType SDL_HAPTIC_RESERVED1 = SDL_HapticEffectType 0x1000 -- | Typed constant for macro @SDL_HAPTIC_RESERVED2@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_RESERVED2 :: SDL_HapticEffectType pattern $mSDL_HAPTIC_RESERVED2 :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_RESERVED2 :: SDL_HapticEffectType SDL_HAPTIC_RESERVED2 = SDL_HapticEffectType 0x2000 -- | Typed constant for macro @SDL_HAPTIC_RESERVED3@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_RESERVED3 :: SDL_HapticEffectType pattern $mSDL_HAPTIC_RESERVED3 :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_RESERVED3 :: SDL_HapticEffectType SDL_HAPTIC_RESERVED3 = SDL_HapticEffectType 0x4000 -- | Typed constant for macro @SDL_HAPTIC_CUSTOM@. Combine with @.|.@ from "Data.Bits". pattern SDL_HAPTIC_CUSTOM :: SDL_HapticEffectType pattern $mSDL_HAPTIC_CUSTOM :: forall {r}. SDL_HapticEffectType -> ((# #) -> r) -> ((# #) -> r) -> r $bSDL_HAPTIC_CUSTOM :: SDL_HapticEffectType SDL_HAPTIC_CUSTOM = SDL_HapticEffectType 0x8000