al_init(3alleg5)
β¨ al_init β Allegro 5 API β¨
okay bestie, welcome to the al_init(3alleg5) page π this is from the Allegro 5 API and it's literally the little macro that gets your whole Allegro life STARTED. buckle up π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
#define al_init() (al_install_system(ALLEGRO_VERSION_INT, atexit))
look at her. one line of macro. iconic. π
π¦ DESCRIPTION π¦
so al_init is basically al_install_system(3alleg5)'s cooler, low-effort twin π«Ά she does the exact same thing, but she's a macro, so she:
- automatically passes in the version β that's
ALLEGRO_VERSION_INT, no cap, you don't have to type it yourself - uses the
atexitfunction that's visible in the current binary, so you don't have to hand her a pointer either
it's giving "I did your homework for you" energy and honestly? obsessed. β
Note: it is typically wrong to callal_initanywhere except the final game binary. π In particular, do not call it inside a shared library unless you know what you're doing β like, genuinely know, not vibes-based know. In those cases, it is better to callal_install_systemeither with aNULLatexit_ptr, or with a pointer toatexitprovided by the user of this shared library. periodt. π
π SEE ALSO π
- al_install_system(3alleg5) β the non-macro bestie, if you need the extra control π
that's the whole page, you ate it, go call your init and slay π₯
Allegro reference manual Β· al_init(3alleg5) β mwah, bye bestie, see you in the docs ππ§ββοΈ
π¦ 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