SDL_HINT_VIDEO_FORCE_EGL(3)

✨ SDL_HINT_VIDEO_FORCE_EGL ✨

ok so bestie, welcome to the SDL3 FUNCTIONS corner of the man pages πŸ’… this one is all about SDL_HINT_VIDEO_FORCE_EGL β€” yes it's a mouthful, no you don't have to say it out loud.


🌸 NAME 🌸

SDL_HINT_VIDEO_FORCE_EGL β€” a variable that controls whether the OpenGL context gets created with EGL. that's it, that's the whole vibe 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_hints.h>

#define SDL_HINT_VIDEO_FORCE_EGL "SDL_VIDEO_FORCE_EGL"

like, that's the whole incantation. include the header, and the hint name is literally the string "SDL_VIDEO_FORCE_EGL" ✨


πŸ’– DESCRIPTION πŸ’–

so the variable can be set to these values, and bestie there are exactly two of them:

  • "0" β€” use the platform-specific GL context creation API (GLX, WGL, CGL, etc). this is the default, it's giving "we'll do the normal thing, don't worry about it" 😌
  • "1" β€” use EGL. periodt. no platform API, just EGL πŸ”₯
⚠️ okay this part matters: this hint should be set before SDL is initialized. set it late and it's giving "too late bestie" 😭

⭐ AVAILABILITY ⭐

this hint has been available since SDL 3.2.0 πŸ¦‹ so if you're on anything older... yeah no, not for you πŸ™ˆ


and that's the page!! slay πŸ’– written up in the Simple Directmedia Layer docs, from SDL 3.4.18 β€” go forth and force your EGL, you main character πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from