SDL_GetNumHapticAxes(3)

πŸ’– SDL_GetNumHapticAxes(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we talk about vibration and axes and honestly it's giving main character energy πŸŽ€


✨ NAME ✨

SDL_GetNumHapticAxes β€” get the number of haptic axes the device has. fr fr that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_haptic.h>

int SDL_GetNumHapticAxes(SDL_Haptic *haptic);

like yes, one include, one function call, we love a low-effort slay πŸ¦‹


πŸ’« DESCRIPTION πŸ’«

So the number of haptic axes? might be useful if you're working with the SDL_HapticDirection effect. that's it. that's the tea. β˜•βœ¨

think of it as a little vibe check for your rumble device β€” you ask how many axes it has, and it tells you. iconic behavior honestly πŸ‘‘


🫢 FUNCTION PARAMETERS 🫢

  • haptic β€” the SDL_Haptic device to query. bestie, this is the device you're asking about, so make sure it's the right one πŸ™ˆ

πŸŽ€ RETURN VALUE πŸŽ€

Returns the number of axes on success πŸ’š or -1 on failure πŸ’€; call SDL_GetError() for more information. yes, always check your errors, no cap, the error function is right there waiting for you πŸ₯Ί


🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. so if you're on anything older, it's not me, it's you πŸ’…


not me writing a whole manual page about axes... but honestly? obsessed. periodt. ✨

Simple Directmedia Layer β€” SDL 3.4.18 β€” mwah, that's the version, that's the source, that's the whole entire vibe. stay haptic, bestie πŸ«ΆπŸ’–πŸŒΈ

πŸ“¦ where this page comes from