SDL_GetJoystickVendor(3)

๐Ÿ’– SDL_GetJoystickVendor(3) ๐Ÿ’–

okay so bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where we find out who actually made your controller ๐ŸŽฎโœจ


โœจ NAME โœจ

SDL_GetJoystickVendor โ€” get the USB vendor ID of an opened joystick, if it's available ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <SDL3/SDL_joystick.h>

Uint16 SDL_GetJoystickVendor(SDL_Joystick *joystick);

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so like, this function goes and grabs the USB vendor ID for you. iconic behaviour, no notes.

but if the vendor ID isn't available, this function returns 0. that's it. that's the whole vibe check. zero. nada. the void ๐Ÿ•ณ๏ธ


๐ŸŽ€ FUNCTION PARAMETERS ๐ŸŽ€

  • joystick โ€” the SDL_Joystick you got from SDL_OpenJoystick(). like, you gotta have actually opened it first, bestie, we can't read the aura of a joystick that doesn't exist yet ๐Ÿ™ˆ

โญ RETURN VALUE โญ

Returns the USB vendor ID of the selected joystick, or 0 if it's unavailable. that's the tea โ˜•


๐Ÿงš THREAD SAFETY ๐Ÿงš

It is safe to call this function from any thread. any thread!! go wild, queen ๐Ÿ‘‘


๐ŸŒˆ AVAILABILITY ๐ŸŒˆ

This function is available since SDL 3.2.0. so if you're on something older... girl. upgrade. ๐Ÿ˜ญ


๐Ÿ’œ SEE ALSO ๐Ÿ’œ


Simple Directmedia Layer really said "here's your joystick lore" and dropped SDL 3.4.18 on us โ€” that's the source and the version, mwah, slay, periodt ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from