SDL_GetNumJoystickButtons(3)

πŸ’– SDL_GetNumJoystickButtons πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_GetNumJoystickButtons β€” she's the one who tells you how many buttons your joystick is serving. no cap.


✨ NAME ✨

SDL_GetNumJoystickButtons β€” get the number of buttons on a joystick. that's it. that's the whole job. and she ate. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_joystick.h>

int SDL_GetNumJoystickButtons(SDL_Joystick *joystick);

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • joystick β€” an SDL_Joystick structure containing joystick information. like, hand her the joystick you're curious about and she'll do the rest, fr fr.

πŸ¦‹ RETURN VALUE πŸ¦‹

She returns the number of buttons on success, or -1 on failure. and if she fails? call SDL_GetError() for more info, because she's not gonna explain herself unprompted. πŸ’€


πŸ”₯ THREAD SAFETY πŸ”₯

It is safe to call this function from any thread. yes queen, thread-safe, go wild, no vibe check needed. 🫢


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. so if you're on something older, bestie, it's giving nothing. upgrade. ✨


🌈 SEE ALSO 🌈

go read those too, they're all part of the same iconic friend group. πŸ‘‘


and that's the whole page, bestie!! this manual page came to you from Simple Directmedia Layer, version SDL 3.4.18 β€” iconic behavior from the SDL girlies, as always. mwah. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from