allegro_error(3alleg4)
β¨ allegro_error β¨
okay so bestie, you're in the Allegro manual, section 3alleg4, and today's main character is allegro_error β she's the one who stores the last Allegro error message. π
πΈ NAME πΈ
allegro_error β stores the last Allegro error message.
π¦ SYNOPSIS π¦
#include <allegro.h>
extern char allegro_error[ALLEGRO_ERROR_SIZE];
π DESCRIPTION π
So this is a text string, right? And the way that set_gfx_mode(), install_sound() and other functions use it is literally just to report error messages. So when they fail and you actually want to tell the user why everything is giving chaos, this is the place to look for a description of the problem. no cap. π«Ά
Example, because seeing it is believing:
void abort_on_error(const char *message)
{
if (screen != NULL)
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
allegro_message("%s.\nLast Allegro error `%s'\n",
message, allegro_error);
exit(-1);
}
...
if (some_allegro_function() == ERROR_CODE)
abort_on_error("Error calling some function!");
iconic behaviour fr fr π
π SEE ALSO π
k bye bestie, go read your error messages, they're lowkey trying to tell you something π
this page came to you courtesy of Allegro, version 4.4.3, filed under allegro_error(3alleg4) β slay, mwah πβ¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms