SDL_HINT_KMSDRM_DEVICE_INDEX(3)

πŸ’– SDL_HINT_KMSDRM_DEVICE_INDEX(3) πŸ’–

okay bestie, sit down, hydrate, and let me tell you about this lil variable from the SDL3 FUNCTIONS manual. it's a whole hint, it's giving "pick your own device", and honestly? iconic. πŸŽ€


✨ NAME ✨

SDL_HINT_KMSDRM_DEVICE_INDEX β€” a variable that controls what KMSDRM device to use. yes queen, it's literally in the name, we love a transparent function. πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_hints.h>

#define SDL_HINT_KMSDRM_DEVICE_INDEX "SDL_KMSDRM_DEVICE_INDEX"

like. that's it. that's the whole vibe. πŸ¦‹


✨ DESCRIPTION ✨

so here's the tea, bestie. SDL might open something like /dev/dri/cardNN to access KMSDRM functionality β€” and the "NN" in there is a device index number. not a nickname, not a vibe, a number. πŸ”’

by default SDL makes a guess at the best index to use (usually zero, lowkey the safe pick), but listen β€” the app or the user can set this hint to a number between 0 and 99 to force the selection. 0 to 99. that's your range. no cap. πŸ‘‘

⚠️ okay important bestie: this hint should be set before SDL is initialized. before. like, get there early, main character energy, don't be fashionably late to this one. πŸ’€

✨ AVAILABILITY ✨

this hint is available since SDL 3.2.0. so if you're on something older, it's not ghosting you, it literally didn't exist yet. 😭


and that's the whole page, fr fr. thanks for reading, you ate. πŸ“

Simple Directmedia Layer made this, we're on SDL 3.4.18, and this little slice of manpage magic is SDL_HINT_KMSDRM_DEVICE_INDEX(3). mwah. πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from