al_get_system_config(3alleg5)

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

✨ al_get_system_config ✨

okay bestie, welcome to the Allegro 5 API corner of the manual πŸ’– this one's short but it's giving main character config energy, so let's get into it πŸŽ€


🌸 NAME 🌸

al_get_system_config β€” Allegro 5 API (yes that's the whole name, she's simple, she's iconic)


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro5/allegro.h>

ALLEGRO_CONFIG *al_get_system_config(void)

πŸ’… DESCRIPTION πŸ’…

So basically, this function returns the system configuration structure. That's it, that's the whole vibe ✨

🚨 BIG ONE, bestie: the configuration you get back should NOT be destroyed with al_destroy_config(3alleg5). Not yours to destroy, hands off, no cap πŸ™ˆ

What's it even for? Mainly for configuring Allegro and its addons. And here's the cute part β€” you can populate this config before Allegro is installed to control stuff like the logging levels and other features πŸ‘‘


🧚 How Allegro fills this thing in 🧚

Allegro will try to populate this configuration by loading a config file from a few different locations, in this exact order:

  • Unix only: /etc/allegro5rc
  • Unix only: $HOME/allegro5rc
  • Unix only: $HOME/.allegro5rc
  • allegro5.cfg next to the executable

If it finds multiple copies, they get merged using al_merge_config_into(3alleg5) 🌈 β€” like a little config group hug, obsessed.


πŸ“ Where the contents are documented πŸ“

The contents of this file are documented inside a prototypical allegro5.cfg that you can find in the root directory of the source distributions of Allegro. They are also reproduced below, iykyk πŸ’œ

__ALLEGRO_5_CFG
⚠️ Note, and this is important: Allegro will not look into that file unless you make a copy of it and place it next to your executable! So don't just sit there wondering why nothing's happening, bestie 😭

πŸ’– cute sign-off πŸ’–

and that's the tea 🫢 this page lives in the Allegro reference manual, filed under al_get_system_config(3alleg5). go forth and configure slayfully βœ¨πŸ’…πŸŒΈ

πŸ“¦ where this page comes from