al_init(3alleg5)

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

✨ 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 atexit function 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 call al_init anywhere 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 call al_install_system either with a NULL atexit_ptr, or with a pointer to atexit provided by the user of this shared library. periodt. πŸ‘‘

🌈 SEE ALSO 🌈


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