AL_ID(3alleg4)

πŸ’– AL_ID πŸ’–

okay bestie, so this is AL_ID from the Allegro manual, section 3alleg4, and it's literally the cutest little macro for making IDs. no cap.


✨ NAME ✨

AL_ID β€” converts four 8 bit values to a packed 32 bit integer ID. it's giving Allegro game programming library energy. πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro.h>

Macro AL_ID(a,b,c,d)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this macro? it can be used to create a packed 32 bit integer from 8 bit characters, and it works on both 32 and 64 bit machines. periodt. πŸ’…

these can be used for various things, like custom datafile objects or system IDs. main character utility macro fr fr. πŸ‘‘

example time, bestie:

#define OSTYPE_LINUX       AL_ID('T','U','X',' ')

the way that just packs 'T', 'U', 'X', and ' ' into one iconic 32 bit integer? obsessed. ✨


πŸ‘€ SEE ALSO πŸ‘€


that's the whole vibe, no notes. πŸ’œ

this was Allegro version 4.4.3, mwah, bye bestie! πŸŽ€βœ¨πŸ’–