SDL_HINT_OPENGL_ES_DRIVER(3)

πŸ’– SDL_HINT_OPENGL_ES_DRIVER πŸ’–

okay bestie, welcome to the SDL_HINT_OPENGL_ES_DRIVER page from the SDL3 FUNCTIONS manual πŸ’… this is the little hint that decides which driver gets to handle your OpenGL ES contexts, and honestly? it's giving main character energy for a string constant.


✨ NAME ✨

SDL_HINT_OPENGL_ES_DRIVER β€” a variable controlling what driver to use for OpenGL ES contexts. literally that's it, that's the whole job πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER"

no cap, that's the whole include-and-define situation 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• on some platforms β€” currently Windows and X11 β€” your OpenGL drivers might be able to create contexts with an OpenGL ES profile. iconic of them. by default, SDL uses those profiles when they're available, and if they're not available it goes and tries to load an OpenGL ES library instead, e.g. the one the ANGLE project provides. this variable is the vibe check that controls whether SDL follows that default behaviour, or just always loads an OpenGL ES library no matter what πŸ”₯

circumstances where this is actually useful, bestie:

  • testing an app with a particular OpenGL ES implementation, e.g. ANGLE, or an emulator, e.g. those from ARM, Imagination or Qualcomm πŸ‘‘
  • resolving OpenGL ES function addresses at link time by linking with the OpenGL ES library instead of querying them at run time with SDL_GL_GetProcAddress()
⚠️ Caution: for an application to work with the default behaviour across different OpenGL drivers, it must query the OpenGL ES function addresses at run time using SDL_GL_GetProcAddress(). like, must must. don't skip this one 😭

This variable is ignored on most platforms because OpenGL ES is native there or just plain not supported. so don't come for it when it does nothing on your platform, it's not being rude, it's just built different πŸ™ˆ

the variable can be set to the following values:

  • "0" β€” use the ES profile of OpenGL, if available. (this is the default, the og, the one you get for free πŸ’–)
  • "1" β€” load the OpenGL ES library using the default library names. go off, be explicit πŸ’…
🌟 this hint should be set before SDL is initialized. before, bestie. not during, not after. before. periodt.

🌈 AVAILABILITY 🌈

this hint is available since SDL 3.2.0 ✨ so if you're on anything older... yeah no, it's not there yet 🫠


and that's the whole page!! mwah πŸ’œ

Simple Directmedia Layer β€” SDL 3.4.18 β€” SDL_HINT_OPENGL_ES_DRIVER(3) πŸŽ€ thanks for reading, ily, go set your hints before init πŸ¦‹

πŸ“¦ where this page comes from