SDL_HINT_RENDER_DRIVER(3)

πŸ’– SDL_HINT_RENDER_DRIVER πŸ’–

okay bestie, gather round, because this is a manual page from the SDL3 functions crew and it's literally about picking your render driver. yes, the whole thing. it's giving "choose your fighter" but for graphics APIs. πŸŽ€


✨ NAME ✨

SDL_HINT_RENDER_DRIVER β€” a variable specifying which render driver to use. that's it, that's the whole vibe. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER"

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: if your application doesn't pick a specific renderer to use, this variable is the one that says which renderer is the preferred one. main character energy, fr fr. 😌

but listen β€” if that preferred renderer can't be initialized, then creating a renderer will fail. no fallback fantasy, no plan B. it's giving all-or-nothing. πŸ’€

this variable is case insensitive and can be set to these values, periodt:

  • "direct3d"
  • "direct3d11"
  • "direct3d12"
  • "opengl"
  • "opengles2"
  • "opengles"
  • "metal"
  • "vulkan"
  • "gpu"
  • "software"

ngl this hint also accepts a comma-separated list of driver names, and each one gets tried in the order listed when creating a renderer β€” until one succeeds or every single one of them fails. it's a whole audition process, and someone's getting the role. 🎬✨

the default varies by platform, but it's the first one in the list that's available on the current platform. iykyk. 🌈

⚠️ this hint should be set before creating a renderer. not after. before. bestie, please. πŸ™ˆ

⭐ AVAILABILITY ⭐

this hint has been available since SDL 3.2.0. iconic behavior honestly. πŸ‘‘


that's the whole page, no cap. brought to you by the Simple Directmedia Layer girlies, SDL 3.4.18 edition. πŸ«ΆπŸ’… go forth and pick your driver, you got this. πŸ¦‹πŸ’–

πŸ“¦ where this page comes from