SDL_GetJoyst...sInitialState(3)
β¨ NAME β¨
SDL_GetJoystickAxisInitialState β bestie, this is how you get the initial state of an axis control on a joystick π
(and yes, this is from the SDL3 FUNCTIONS manual, we're fancy here)
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_joystick.h>
bool SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state);
π¦ DESCRIPTION π¦
okay so the state you get back is a value ranging from -32768 to 32767. that's the whole vibe, full range, no cap π
and the axis indices? they start at index 0. zero-based, like a normal person. periodt.
π FUNCTION PARAMETERS π
joystickβ anSDL_Joystickstructure containing joystick information. it's giving "the whole joystick, ma'am" πaxisβ the axis to query; the axis indices start at index0. yes, again,0. starting from zero, iconic behavior βstateβ upon return, the initial value is supplied here. it's an out-param bestie, so it gets filled in for you π«Ά
π₯ RETURN VALUE π₯
Returns true if this axis has any initial value, or false if not. that's it, that's the tea β
π§ THREAD SAFETY π§
It is safe to call this function from any thread. go off, multithreaded queen π
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on something older... it's not there, sorry bestie π
Simple Directmedia Layer β¨ SDL 3.4.18 β mwah, that's a wrap, go read your joystick axes and slay ππ
π¦ 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