SDL_HINT_VIDEO_DRIVER(3)

πŸ’– NAME πŸ’–

SDL_HINT_VIDEO_DRIVER β€” bestie, it's a variable that tells SDL which video backend to use. That's it, that's the whole vibe. πŸ‘‘


✨ SYNOPSIS ✨

#include <SDL3/SDL_hints.h>

#define SDL_HINT_VIDEO_DRIVER "SDL_VIDEO_DRIVER"

πŸŽ€ DESCRIPTION πŸŽ€

okay so, by default? SDL is out here doing the absolute most β€” it's gonna try all the available video backends in a reasonable order, one after another, until it finds one that actually works. iconic behavior honestly. πŸ¦‹

but sometimes you're like. no. I want this one. and that's literally what this hint is for β€” it lets the app or the user force a specific target. like, say you're on Wayland but you lowkey want to try talking to the X server instead? boom. force "x11". problem solved, no cap. πŸ’…

this hint also accepts a comma-separated list of driver names, and fr fr each one gets tried in the order you listed them during init β€” until one succeeds or all of them fail 😭. so the order matters, bestie, don't just be throwing names in there.

🌸 heads up!! this hint should be set before SDL is initialized. set it late and it's giving… nothing. πŸ’€

🌈 AVAILABILITY 🌈

this hint has been around since SDL 3.2.0. so if you're on something older, sorry babe, you're on your own. πŸ™ˆ


written by the lovely humans over at Simple Directmedia Layer, shipped with SDL 3.4.18 πŸ’œ mwah, go slay your video backend choices, ily, bye!! 🫢✨

πŸ“¦ where this page comes from