SDL_GetGamepadName(3)

💖 SDL_GetGamepadName 💖

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we learn the vibes of an opened gamepad. yes literally, its name. iconic.


✨ NAME ✨

SDL_GetGamepadName — get the implementation-dependent name for an opened gamepad. 🎮


✨ SYNOPSIS ✨

#include <SDL3/SDL_gamepad.h>

const char * SDL_GetGamepadName(SDL_Gamepad *gamepad);

✨ FUNCTION PARAMETERS ✨

  • gamepad — a gamepad identifier that was previously returned by SDL_OpenGamepad(). not just any random pointer, bestie, it has to be one of those. 🙈

✨ RETURN VALUE ✨

it returns the implementation dependent name for the gamepad 🫶

or NULL if there's no name, or if the identifier you passed is invalid. invalid id = NULL, no cap. 💀


✨ THREAD SAFETY ✨

good news, queen 👑 — it is safe to call this function from any thread. go wild, spawn them all, she doesn't care. ✨


✨ AVAILABILITY ✨

this function has been available since SDL 3.2.0. so if you're on something older… sorry bestie 😭


✨ SEE ALSO ✨


and that's the whole page, mwah. 🎀 this lil masterpiece comes to you from Simple Directmedia Layer, version SDL 3.4.18 — stay slaying, and may all your gamepads have names. 🦋🌸💜

📦 where this page comes from