Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Error information from Allegro 5

This thread is locked; no one can reply to it. rss feed Print
Error information from Allegro 5
Luiji99
Member #12,254
September 2010

I'm working on a C++ wrapper library for Allegro 5 because I'm bored and lifeless.

While writing it I ran into the issue that I can't figure out how to get an error message from Allegro. I can get that something failed, but I can't get why.

What I'm doing right now is stuff like:

bitmap(int width, int height) {
if (!(bmp = al_create_bitmap(width, height))
throw error("al_create_bitmap");
}

...that way errors can at least be traced to which Allegro method failed without needing lots of redundant code. It'd be nice to be able to get the actual error message.

Back in Allegro 4 I could just read from allegro_error. I miss that :(

EDIT: just found al_get_errno. Is this the closest to allegro_error A5 has?

Programming should be fun. That's why I hate Java.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: