al_get_opengl_extension_list(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

al_get_opengl_extension_list β€” Allegro 5 API πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_opengl.h>

ALLEGRO_OGL_EXT_LIST *al_get_opengl_extension_list(void)

πŸ’… DESCRIPTION πŸ’…

okay bestie so listen, this one hands you back the list of OpenGL extensions that Allegro supports, for the given display. that's it, that's the vibe πŸ¦‹

Allegro lowkey keeps track of every extension it knows about inside a structure, and al_get_opengl_extension_list is the function that gives you that structure. periodt.

like, for example:

if (al_get_opengl_extension_list()->ALLEGRO_GL_ARB_multitexture) {
   //use it
}

so the way it works is: an extension gets set to true if it's available for the given display, and false if it's not. no in-between, no "maybe", it's giving yes or no energy πŸ’€

and the tea is, this means that to actually use the definitions and functions from an OpenGL extension, literally all you gotta do is check for it like the code above, at run time, after you've acquired the OpenGL display from Allegro. that's the whole move. slay ✨

oh and btw, under Windows this also works with WGL extensions, and under Unix it works with GLX extensions. double duty, we love to see it 🫢


🧚 If you wanna do it yourself 🧚

so like, say you want to manually check for extensions and load function pointers yourself (maybe because the Allegro developers haven't included it yet, no shade), then you can use al_have_opengl_extension(3alleg5) and al_get_opengl_proc_address(3alleg5) instead. main character energy, you got this πŸ’…

Note: the exact extensions exposed depend on how Allegro was compiled πŸ‘€. It is recommended to use al_have_opengl_extension(3alleg5) and al_get_opengl_proc_address(3alleg5) for the most stable experience. fr fr, trust the process πŸ”₯

and that's the page, bestie πŸ’– this came to you from the Allegro reference manual, home of al_get_opengl_extension_list(3alleg5) β€” go forth and check your extensions, you iconic genius you πŸ‘‘

πŸ“¦ where this page comes from