SDL_GL_ExtensionSupported(3)
β¨ SDL_GL_ExtensionSupported β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual π this one is SDL_GL_ExtensionSupported and it does exactly one (1) job: telling you whether an OpenGL extension is supported for the current context. that's it. that's the whole vibe check. π¦
πΈ NAME πΈ
SDL_GL_ExtensionSupported β check if an OpenGL extension is supported for the current context.
π SYNOPSIS π
#include <SDL3/SDL_video.h>
bool SDL_GL_ExtensionSupported(const char *extension);
π DESCRIPTION π
so here's the tea, and it's important tea: this function operates on the current GL context. not some context you're dreaming about, not a context you'll make later β the one that's current right now. you must have created a context, and it must be current, before you even think about calling this. periodt.
and like, do not assume that all the contexts you create will have the same set of extensions available. they might not! also do not assume that recreating an existing context will offer the same extensions again. contexts are giving main character energy and they will simply do what they want. π
now, about performance β while it's probably not a massive overhead, this function is not an O(1) operation. so the move is: check the extensions you care about right after creating the GL context, and then save that information somewhere instead of calling this function every single time you need to know. she's not a free little lookup, she's a whole function call. π
bestie note: check once, write it down, move on. your frame time will thank you. π«Ά
β FUNCTION PARAMETERS β
extensionβ the name of the extension to check. π
π RETURN VALUE π
Returns true if the extension is supported, false otherwise. no in-between, no situationship. π
π₯ THREAD SAFETY π₯
This function should only be called on the main thread. don't be sending her off to a worker thread, she will not slay there. π
π AVAILABILITY π
This function is available since SDL 3.2.0. iconic behavior honestly. β¨
mwah π that's the whole page, you ate it, go forth and query your extensions responsibly. this one came to you from Simple Directmedia Layer, running the SDL 3.4.18 era of the manual β and yes, SDL_GL_ExtensionSupported(3) is the name, say it with your chest. ππ¦πΈ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms