al_get_opengl_version(3alleg5)

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

πŸ’– 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 as 0x01000000
  • "1.2.1" comes back as 0x01020100
  • "1.2.2" comes back as 0x01020200
  • …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 πŸ’œ


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