sdlHapticUpdateEffect function

int sdlHapticUpdateEffect(
  1. Pointer<SdlHaptic> haptic,
  2. int effect,
  3. Pointer<SdlHapticEffect> data
)

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_HapticUpdateEffect().

\param haptic the SDL_Haptic device that has the effect \param effect the identifier of the effect to update \param data an SDL_HapticEffect structure containing the new effect properties to use \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_HapticDestroyEffect \sa SDL_HapticNewEffect \sa SDL_HapticRunEffect

extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data)

Implementation

int sdlHapticUpdateEffect(
    Pointer<SdlHaptic> haptic, int effect, Pointer<SdlHapticEffect> data) {
  final sdlHapticUpdateEffectLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<SdlHaptic> haptic, Int32 effect,
          Pointer<SdlHapticEffect> data),
      int Function(Pointer<SdlHaptic> haptic, int effect,
          Pointer<SdlHapticEffect> data)>('SDL_HapticUpdateEffect');
  return sdlHapticUpdateEffectLookupFunction(haptic, effect, data);
}