SDL_GetNumJoystickBalls(3)
π SDL_GetNumJoystickBalls(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where we count trackballs like it's a personality quiz π
β¨ NAME β¨
SDL_GetNumJoystickBalls β get the number of trackballs on a joystick. yes literally, that's the whole gig, and it's iconic for it π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_joystick.h>
int SDL_GetNumJoystickBalls(SDL_Joystick *joystick);
π¦ DESCRIPTION π¦
okay so real talk: joystick trackballs are lowkey mysterious. they only have relative motion events attached to them, and their state cannot be polled. so like, no asking "hey ball, where you at right now?" β that's just not a thing, bestie π
also, important vibe check: most joysticks do not have trackballs. so if this function hands you a 0, that's not a bug, that's just the average joystick living its truth π
π FUNCTION PARAMETERS π
joystickβ anSDL_Joystickstructure containing joystick information. give it your joystick, it'll do the counting, no notes π
β RETURN VALUE β
returns the number of trackballs on success, or -1 on failure. and if it fails? call SDL_GetError() for more information, because the error message is where the tea is β
π₯ THREAD SAFETY π₯
it is safe to call this function from any thread. yes bestie, any thread, no drama, no locks, we love a low-maintenance icon π
π AVAILABILITY π
this function has been available since SDL 3.2.0. so if you're on something olderβ¦ no it isn't, sorry π«Ά
π SEE ALSO π
SDL_GetJoystickBall(3)SDL_GetNumJoystickAxes(3)SDL_GetNumJoystickButtons(3)SDL_GetNumJoystickHats(3)
and that's the whole page, fr fr π this came to you courtesy of Simple Directmedia Layer, rocking SDL 3.4.18 β go forth and count those balls, bestie, and remember: zero is a valid answer and you're still slaying β¨ππ¦
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms