SDL_GetVideoDriver(3)
π SDL_GetVideoDriver(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we are about to get the name of a built in video driver. yes. that's it. that's the whole job. and she does it flawlessly, no cap. π
β¨ NAME β¨
SDL_GetVideoDriver β Get the name of a built in video driver.
like, literally just the name. she's not launching anything, she's not configuring anything, she's just handing you the receipt. π§Ύπ
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_video.h>
const char * SDL_GetVideoDriver(int index);
π¦ DESCRIPTION π¦
okay so here's the tea: the video drivers are presented in the order in which they are normally checked during initialization. so like, index 0 isn't "the best one" or "the main character" β she's just first in line when SDL goes down the list. the order is the information, iykyk. π₯
and the names themselves? the names of drivers are all simple, low-ASCII identifiers, like "cocoa", "x11" or "windows". these never have Unicode characters β not a single one, not even a sneaky emoji, we stay disciplined β and they are not meant to be proper names. so don't go showing them off at a dinner party as if they're legal names, they're more like... usernames. handles. lowercase little gremlins. π
π FUNCTION PARAMETERS π
indexβ the index of a video driver. that's the vibe. just a number. π
β RETURN VALUE β
returns the name of the video driver with the given index, or NULL if index is out of bounds. so if you're color-coding your life: got a string back? slay. got NULL? you went too far, babe, there's nothing over there. π
π THREAD SAFETY π
this function should only be called on the main thread. that's it. that's the rule. don't be out here calling her from some random thread like it's a group chat at 2am. main thread only, periodt. π«Ά
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on anything older, she simply does not exist for you yet, and that's just the timeline we're in. π°οΈ
π SEE ALSO π
SDL_GetNumVideoDrivers(3)β go check how many of these lil guys there even are before you start indexing into the void. π
π§ bye bestie π§
that's the whole page!! this one came from Simple Directmedia Layer, rocking SDL 3.4.18, and it was documented for us on the same day as the SDL_GetVideoDriver(3) header up top says. go forth, loop over your drivers, and stay in bounds. mwah. πβ¨πΈ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms