Made SDL_HapticEffect const in the API

Also added some additional parameter validation to haptic effect functions
This commit is contained in:
Sam Lantinga
2024-01-21 10:56:32 -08:00
parent fa5bfe577c
commit 052b958bf2
11 changed files with 61 additions and 49 deletions

View File

@@ -1090,7 +1090,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumHapticAxes(SDL_Haptic *haptic);
* \sa SDL_CreateHapticEffect
* \sa SDL_GetHapticFeatures
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, SDL_HapticEffect *effect);
extern DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
/**
* Create a new haptic effect on a specified device.
@@ -1107,7 +1107,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, S
* \sa SDL_RunHapticEffect
* \sa SDL_UpdateHapticEffect
*/
extern DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, SDL_HapticEffect *effect);
extern DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
/**
* Update the properties of an effect.
@@ -1130,7 +1130,7 @@ extern DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, SDL_Hapti
* \sa SDL_CreateHapticEffect
* \sa SDL_RunHapticEffect
*/
extern DECLSPEC int SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, SDL_HapticEffect *data);
extern DECLSPEC int SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data);
/**
* Run the haptic effect on its associated haptic device.