|
Bitmap not loading again |
Auradrummer
Member #15,778
October 2014
|
Hi masters, I'm cannot load bitmap from this code: 1#include "allegro5/allegro.h"
2#include "allegro5/allegro_image.h"
3#include "allegro5/allegro_native_dialog.h"
4
5int main(int argc, char **argv){
6
7 ALLEGRO_DISPLAY *display = NULL;
8 ALLEGRO_BITMAP *image = NULL;
9
10 al_init();
11 al_init_image_addon();
12 display = al_create_display(800,600);
13
14 ALLEGRO_FILE * file = al_fopen("altestfile.alt","w");
15 image = al_load_bitmap("bit.tga");
16
17 if(!image)
18 {
19 al_show_native_message_box(display, "Error", "Error", "Failed to load image!",
20 NULL, ALLEGRO_MESSAGEBOX_ERROR);
21 al_destroy_display(display);
22 return 0;
23 }
24
25 al_draw_bitmap(image,200,200,0);
26 al_flip_display();
27 al_rest(2);
28 al_destroy_display(display);
29 al_destroy_bitmap(image);
30 return 0;
31}
As you can see, is the allegro example. I really do not know where the problem lies. Next step is to format my system. Thanks masters! |
Arthur Kalliokoski
Second in Command
February 2005
|
Try al_init_image_addon() before loading. They all watch too much MSNBC... they get ideas. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
The code he's showing says he already did that. I'd say to see here : but it looks like it should be working. Try using the absolute path to your file when loading, and if that doesn't work, it may be something wrong with the file, but it shouldn't be if it is just a copy of one of allegro's tga files. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
pkrcel
Member #14,001
February 2012
|
Allegro log might be worth looking at to check if there is any error code given out from the image addon. It is unlikely that Google shares your distaste for capitalism. - Derezo |
Thomas Fjellstrom
Member #476
June 2000
|
In order for there to be an allegro.like g file you have to link to the allegro debug lib. FYI. -- |
|