SDL_GamepadHasAxis(3)

πŸ’… SDL_GamepadHasAxis β€” it's giving "does this controller even have that axis bestie"

okay so this is a page from the SDL3 FUNCTIONS collection, and the star of the show is SDL_GamepadHasAxis(3). Let's get into it πŸŽ€


✨ NAME ✨

SDL_GamepadHasAxis β€” literally just asking: does this gamepad have a given axis? yes or no, that's the whole vibe check πŸ¦‹


✨ SYNOPSIS ✨

#include <SDL3/SDL_gamepad.h>

bool SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);

✨ DESCRIPTION ✨

So here's the tea β˜• β€” this function merely reports whether the gamepad's mapping defined this axis. That's it. That's all it's doing. Because lowkey, that's all the information SDL actually has about the physical device. It's not out here sniffing your controller's hardware, it's just checking the mapping, periodt πŸ’…


✨ FUNCTION PARAMETERS ✨

  • gamepad β€” a gamepad. (yes bestie, that's the whole description, iconic of them honestly 🫢)
  • axis β€” an axis enum value (an SDL_GamepadAxis value).

✨ RETURN VALUE ✨

Returns true if the gamepad has this axis, and false otherwise. Binary. No in-between. Slay ✨


✨ THREAD SAFETY ✨

It is safe to call this function from any thread. Go wild, call it from wherever, no cap 🌈


✨ AVAILABILITY ✨

This function has been available since SDL 3.2.0 β€” so if you're on something older, sorry bestie, it's not there 😭


✨ SEE ALSO ✨


ngl this one is a short read, but every single detail matters fr fr β€” no skipping πŸŽ€

and that's the page!! brought to you by Simple Directmedia Layer, sitting pretty at SDL 3.4.18 πŸ’– go check your axes, bestie, and stay iconic πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from