al_get_opengl_version(3alleg5)
π al_get_opengl_version β Allegro 5 API π
okay bestie, welcome to the al_get_opengl_version(3alleg5) page, part of the Allegro reference manual β¨ this one is short and sweet and it's literally just "hey what GL version are we on" β let's go π¦
β¨ NAME β¨
al_get_opengl_version β Allegro 5 API π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro_opengl.h>
uint32_t al_get_opengl_version(void)
π DESCRIPTION π
So what this does is it hands you back the OpenGL or OpenGL ES version number of the client β that's the computer the program is running on, not some server somewhere, bestie β and it's the version for the current display. π
And the way it formats that number is a whole vibe, so pay attention:
"1.0"comes back as0x01000000"1.2.1"comes back as0x01020100"1.2.2"comes back as0x01020200- β¦and etc., you get the pattern, each chunk of the version gets its own byte π
β οΈ okay this is the important part, no skipping: a valid OpenGL context must exist for this function to work. Which means you may not call it before al_create_display(3alleg5). Like, do not. It will not go well. Call it too early and you're just out here asking about a display that doesn't exist yet π
π SEE ALSO π
al_get_opengl_variant(3alleg5)β the other half of the GL info duo, go read it π§
and that's the whole page, bestie!! ππ short king of a manpage but it does exactly what it says on the tin, periodt β¨
Allegro reference manual π β mwah, tysm for reading, ily, go check your GL context first tho π π«ΆπΈ
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms