![]() |
|
[A5] Possible to make alerts? |
tariel36
Member #14,214
April 2012
|
Hello, I wonder if it is possible to make windows-like error alerts in Allegro. I've found al_set_errno(); and al_get_errno(); functions in manula but I'm not sure how to use it. (Till now I used to report errors in console, but now I wanted to get rid of it). |
Arthur Kalliokoski
Second in Command
February 2005
![]() |
For most errors, just putting a string into a dialog box will suffice, e.g. 1 if(!al_init())
2 {
3 al_show_native_message_box(0, "Error", "Failed to initialize Allegro", "", NULL, 0);
4 return 1;
5 }
6 .
7 .
8 .
9 display = al_create_display(display_width, display_height);
10 if (!display)
11 {
12 al_show_native_message_box(0, "Error", "Couldn't create display", "", NULL, 0);
13 return 1;
14 }
15 .
16 .
17 .
18 faceimg = al_load_bitmap("face.tga");
19 if(!faceimg)
20 {
21 al_show_native_message_box(display, "Error", "Unable to load \"face.tga\"", "", NULL, 0);
22 return 1;
23 }
If you want to get specific strings such as EWOULDBLOCK etc., you'd have to reference those strings manually. They all watch too much MSNBC... they get ideas. |
tariel36
Member #14,214
April 2012
|
Thanks for fast reply! It should do the job |
|