al_run_main(3alleg5)

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

✨ NAME ✨

okay so al_run_main β€” it's giving Allegro 5 API energy, bestie. This page is literally called al_run_main(3alleg5), and we're about to make it make sense. πŸ’–


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

int al_run_main(int argc, char **argv, int (*user_main)(int, char **))

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea: this function is your bestie when you don't have a main() function but you still wanna run Allegro. It's mostly useful inside a wrapper library, iykyk. 🫢

On Windows and Linux, this is lowkey no problem at all β€” you can simply call al_install_system(3alleg5) and go about your day. Slay. ✨

But some other systems β€” like OSX β€” do not allow calling al_install_system(3alleg5) in the main thread. And that's exactly where al_run_main comes in: it will know what to do in that case. No cap. πŸ‘‘

The argc and argv you pass in will simply be passed on to user_main, and the return value of user_main will be returned. That's it, that's the whole vibe. πŸ’…


and that's the page, bestie πŸŽ€ β€” this was from the Allegro reference manual, with the manual name al_run_main(3alleg5) up top. No date was listed in the footer, just the manual name and source. periodt. πŸ’œ

πŸ“¦ where this page comes from