SDL_HINT_VIDEO_EGL_ALLOW_GETDISPLAY_FALLBACK(3)

πŸ’– SDL_HINT_VIDEO_EGL_ALLOW_GETDISPLAY_FALLBACK(3) πŸ’–

okay bestie, so this is one of those SDL3 hints β€” the lil environment-variable-ish knobs you set before SDL wakes up β€” and this one is called SDL_HINT_VIDEO_EGL_ALLOW_GETDISPLAY_FALLBACK. It's giving "backup plan energy," and honestly? Iconic. πŸŽ€


✨ NAME ✨

SDL_HINT_VIDEO_EGL_ALLOW_GETDISPLAY_FALLBACK β€” literally the setting that says: if eglGetPlatformDisplay fails, fall back to calling eglGetDisplay. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_VIDEO_EGL_ALLOW_GETDISPLAY_FALLBACK "SDL_VIDEO_EGL_ALLOW_GETDISPLAY_FALLBACK"

like. that's the whole vibe. include the header, and the macro name is just the string of itself (yes queen, it's self-titled, main character behavior πŸ’…).


πŸ’œ DESCRIPTION πŸ’œ

so the way this works is, you can set this variable to one of these values, no cap:

  • "0" β€” do NOT fall back to eglGetDisplay. nope. not doing it. πŸ™ˆ
  • "1" β€” fall back to eglGetDisplay if eglGetPlatformDisplay fails. (default) ✨
⚠️ important bestie: this hint should be set before SDL is initialized. Like, before. If you're setting it after init, you're late to the party and the party already left. 😭

🫢 AVAILABILITY 🫢

this hint is available since SDL 3.2.0. so if you're on something older... girl. upgrade. 🧚


okay that's the whole page, and that's on periodt. this was brought to you by the lovely humans of Simple Directmedia Layer, documented in SDL 3.4.18 β€” stay slay, set your hints before init, and remember: eglGetDisplay has your back when eglGetPlatformDisplay ghosts you. πŸ’–βœ¨πŸ’…

πŸ“¦ where this page comes from