al_get_allegro_version(3alleg5)
β¨ al_get_allegro_version β¨
okay bestie, welcome to the Allegro reference manual page for al_get_allegro_version β yes the whole manual name is in the title up there, al_get_allegro_version(3alleg5), we're not hiding it π. This one's short and sweet and it's giving "I just want to know what version I'm running" energy. Let's go π¦
πΈ NAME πΈ
al_get_allegro_version β the Allegro 5 API function that tells you what version you've got, no cap π
π SYNOPSIS π
#include <allegro5/allegro.h>
uint32_t al_get_allegro_version(void)
look at her. no arguments, just vibes. she takes void and gives you back a uint32_t π«Ά
π DESCRIPTION π
So basically, al_get_allegro_version returns the compiled version of the Allegro library β as in, the version you actually built against, not some runtime surprise β and it squishes the whole thing into one single integer like the little packing genius it is. The bits are grouped in chunks of 8, in this exact shape:
(major << 24) | (minor << 16) | (revision << 8) | release
four little 8-bit besties stacked in one uint32_t. iconic behaviour, honestly π
Wanna crack it open? Here's the code, copy it exactly, no editing the recipe:
uint32_t version = al_get_allegro_version();
int major = version >> 24;
int minor = (version >> 16) & 255;
int revision = (version >> 8) & 255;
int release = version & 255;
and now the part you actually need to know for the vibe check π β that release number? It's 0 for an unofficial version, and 1 or greater for an official release. So for example, "5.0.2[1]" would be the (first) official 5.0.2 release, while "5.0.2[0]" would be a compile of a version from the "5.0.2" branch before the official release dropped. so likeβ¦ the pre-release era, the beta era, the "we're still cooking" era π§
lowkey important: 0 in that release slot means it's not an official release, so don't be out here treating it like one, bestie π
and that's the whole page, periodt π
bye bestie, go forth and version-check π β this was the Allegro reference manual, al_get_allegro_version(3alleg5), signing off π
π¦ 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