SDL_SetHapticAutocenter(3)

πŸ’– SDL_SetHapticAutocenter(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today we're talking about SDL_SetHapticAutocenter β€” yes, the girlies are setting the global autocenter of the device and we're gonna talk about it ✨


🌸 NAME 🌸

SDL_SetHapticAutocenter β€” set the global autocenter of the device πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3/SDL_haptic.h>

bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter);

there she is. the whole signature. no notes, she's perfect πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: that autocenter value should be between 0 and 100. Setting it to 0 will disable autocentering β€” like, fully off, gone, no more pull-back-to-center energy πŸ™ˆ

⚠️ real talk though: the device must support the SDL_HAPTIC_AUTOCENTER feature. No support, no autocenter. that's just the rules, bestie 😭

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • haptic β€” the SDL_Haptic device you're setting autocentering on 🫢
  • autocenter β€” the value you wanna set autocenter to (0-100) ⭐

πŸ”₯ RETURN VALUE πŸ”₯

she gives back true on success or false on failure β€” and if it's a fail, call SDL_GetError() for more info, because she will absolutely tell you what went wrong πŸ’€


πŸ‘‘ AVAILABILITY πŸ‘‘

this function is available since SDL 3.2.0 β€” so if you're on something older, sorry babe, no autocenter for you 🧚


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! this absolute banger of a manpage came to you courtesy of Simple Directmedia Layer, version SDL 3.4.18 β€” mwah, go set some autocenter, slay, periodt πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from