SDL_GetGamepadType(3)

πŸ’– SDL_GetGamepadType πŸ’–

okay so bestie, we're in the SDL3 FUNCTIONS section of the manual and today's main character is SDL_GetGamepadType β€” literally the glow-up check for your gamepad's identity 🌈


✨ NAME ✨

SDL_GetGamepadType β€” Get the type of an opened gamepad. yep that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gamepad.h>

SDL_GamepadType SDL_GetGamepadType(SDL_Gamepad *gamepad);

like, one include, one function call, zero drama πŸŽ€


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • gamepad β€” the gamepad object to query. that's the lil guy you opened earlier, she's gonna tell you what kind of creature she is πŸ‘‘

πŸ’« RETURN VALUE πŸ’«

Returns the gamepad type, or SDL_GAMEPAD_TYPE_UNKNOWN if it's not available.

ngl if you get SDL_GAMEPAD_TYPE_UNKNOWN back it's giving "mystery box" energy 😭 β€” the type just isn't available, no cap, so don't go guessing at it fr fr.

🧚 THREAD SAFETY 🧚

It is safe to call this function from any thread. periodt. call her from wherever, she's unbothered, she's chill, she's thread-safe πŸ’œ


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. so if you're on something older, sorry bestie, you're getting nothing πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘


k that's the whole page, mwah πŸ’‹

this lil slice of docs came to you from Simple Directmedia Layer β€” SDL 3.4.18 🫢 go forth and query your gamepads, queen 🌸✨

πŸ“¦ where this page comes from