SDL_GetJoysticks(3)
โจ NAME โจ
SDL_GetJoysticks โ bestie, this one gets you a list of every joystick that's currently connected ๐
๐ SYNOPSIS ๐
#include <SDL3/SDL_joystick.h>
SDL_JoystickID * SDL_GetJoysticks(int *count);
๐ธ FUNCTION PARAMETERS ๐ธ
countโ a pointer that gets filled in with how many joysticks got returned. It's giving "optional", because it may beNULL. No pressure, no notes ๐
๐ฆ RETURN VALUE ๐ฆ
Returns a 0 terminated array of joystick instance IDs โ slay. But if it fails it returns NULL instead ๐ญ, and in that case you gotta call SDL_GetError() for more info, fr fr.
Heads up bestie: when you're done with it, free it with SDL_free(). Don't just leave it lying around like an unread group chat ๐
๐ THREAD SAFETY ๐
It is safe to call this function from any thread. Main character energy on every thread, no cap ๐
โญ AVAILABILITY โญ
This function is available since SDL 3.2.0. So if you're on anything older... it's not giving, sorry ๐ซถ
๐ SEE ALSO ๐
okay that's the whole page, go forth and enumerate your controllers, bestie ๐ฎโจ
written under the Simple Directmedia Layer banner, SDL 3.4.18 era, and yes this manual page is literally called SDL_GetJoysticks(3) โ iykyk ๐
๐ฆ 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