SDL_GetJoystickName(3)

๐Ÿ’– SDL_GetJoystickName ๐Ÿ’–

okay so bestie, welcome to SDL_GetJoystickName(3), one of the SDL3 FUNCTIONS โœจ โ€” it's giving "who even IS this controller" energy and honestly? obsessed.


โœจ NAME โœจ

SDL_GetJoystickName โ€” get the implementation dependent name of a joystick ๐ŸŽฎ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <SDL3/SDL_joystick.h>

const char * SDL_GetJoystickName(SDL_Joystick *joystick);

๐ŸŒธ FUNCTION PARAMETERS ๐ŸŒธ

  • joystick โ€” the SDL_Joystick you got from SDL_OpenJoystick(). like, the one you already opened, girl. you can't just ask a stranger their name ๐Ÿ’…

๐Ÿ‘‘ RETURN VALUE ๐Ÿ‘‘

Returns the name of the selected joystick ๐Ÿซถ

But listen โ€” if no name can be found, this function returns NULL. and then? you go call SDL_GetError() for more info, because bestie we do not suffer in silence ๐Ÿ˜ญ


๐Ÿงš THREAD SAFETY ๐Ÿงš

It is safe to call this function from any thread. periodt. no notes, no drama, no mutexes needed ๐Ÿ”ฅ


โญ AVAILABILITY โญ

This function is available since SDL 3.2.0 โ€” so if you're on anything older, it's a no from her, sorry babe ๐Ÿ’€


๐ŸŒˆ SEE ALSO ๐ŸŒˆ


not me hyping up a getter function but like... it's literally how you find out what your controller is called. main character energy fr fr ๐Ÿ™ˆ

mwah ๐Ÿ’œ that's the whole page, bestie โ€” brought to you by the fine folks at Simple Directmedia Layer, SDL 3.4.18, and yes the date is on the original footer too, iykyk. go forth and name some joysticks ๐Ÿฆ‹โœจ

๐Ÿ“ฆ where this page comes from