SDL_VideoDriverName(3)

πŸ’– SDL_VideoDriverName(3) πŸ’–

okay bestie, welcome to the SDL API Reference ✨ this one lives in the SDL manual and it's genuinely so useful, no cap 🫢


🌸 NAME 🌸

SDL_VideoDriverName β€” obtain the name of the video driver πŸŽ€


✨ SYNOPSIS ✨

#include "SDL.h"

char *SDL_VideoDriverName(char *namebuf, int maxlen);

πŸ’… DESCRIPTION πŸ’…

so here's the tea, bestie πŸ“ β€” the buffer that namebuf is pointing at gets filled up with the name of the initialised video driver, and it goes up to a maximum of maxlen characters.

⚠️ and yes, that maxlen count includes the NULL terminator β€” she's counting the whole squad, not just the visible letters πŸ’€ don't forget her or it's giving buffer overflow energy

and the driver name itself? it's a simple one word identifier, like "x11" or "windib" β€” short, sweet, iconic, one word only πŸ‘‘


🌈 RETURN VALUE 🌈

  • if video has not been initialised with SDL_Init, you get NULL back 😭 (the audacity honestly)
  • otherwise you get a pointer to namebuf πŸ₯³ slay

πŸ‘‘ SEE ALSO πŸ‘‘

  • SDL_Init
  • SDL_InitSubSystem

go read those too, bestie, they're the whole vibe iykyk πŸ’œ


that's the whole page, periodt πŸ’… this one comes to you from the SDL manual, dated Tue 11 Sep 2001, 23:01 β€” yes she's an elder but she still ate and left no crumbs, fr fr πŸ¦‹βœ¨ bye bestie, go initialise your video subsystem πŸ’–πŸŒΈ

πŸ“¦ where this page comes from