SDL_RunHapticEffect
Run the haptic effect on its associated haptic device.
- Provided by: libsdl3-doc (Version: 3.4.2+ds-1ubuntu1)
- Source: libsdl3
- Report a bug
Run the haptic effect on its associated haptic device.
#include <SDL3/SDL_haptic.h>
bool SDL_RunHapticEffect(SDL_Haptic *haptic, SDL_HapticEffectID effect, Uint32 iterations);
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 SDL_GetError() for more information.
This function is available since SDL 3.2.0.
SDL_GetHapticEffectStatus(3), SDL_StopHapticEffect(3), SDL_StopHapticEffects(3)