SDL_GetGamepadProduct(3)

๐Ÿ’– SDL_GetGamepadProduct ๐Ÿ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're talking about SDL_GetGamepadProduct โ€” the little function that tells you the USB product ID of an opened gamepad, if it even has one to give you. no cap. ๐ŸŽฎโœจ


โœจ NAME โœจ

SDL_GetGamepadProduct โ€” get the USB product ID of an opened gamepad, if available.


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <SDL3/SDL_gamepad.h>

Uint16 SDL_GetGamepadProduct(SDL_Gamepad *gamepad);

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so basically, you hand it a gamepad and it goes and finds the USB product ID for you. iconic behavior, honestly.

but here's the tea: if the product ID isn't available, this function just returns 0. like, zero, nada, nothing. don't come for it, it tried its best. ๐Ÿซถ


๐ŸŽ€ FUNCTION PARAMETERS ๐ŸŽ€

  • gamepad โ€” the gamepad object you wanna query. that's the one. the main character. ๐Ÿ‘‘

โญ RETURN VALUE โญ

Returns the USB product ID, or zero if it's unavailable. simple as that, periodt. ๐Ÿ’…


๐ŸŒˆ THREAD SAFETY ๐ŸŒˆ

it is safe to call this function from any thread. yes bestie, ANY thread. go wild. ๐Ÿงšโœจ


๐Ÿ’œ AVAILABILITY ๐Ÿ’œ

this function has been available since SDL 3.2.0. it's been here, serving looks, since day one. ๐Ÿ’–


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


and that's the whole vibe, bestie. go forth and query those product IDs responsibly. ๐ŸŽ€๐ŸŒธ๐Ÿฆ‹

โ€” brought to you by Simple Directmedia Layer, version SDL 3.4.18, page SDL_GetGamepadProduct(3). mwah. ๐Ÿ’‹โœจ

๐Ÿ“ฆ where this page comes from