Hello,
I´m having some trouble with Images on Allegro. As I wasn´t able to find really helpful tutorials on Allegro 5 I decided to read API specification
As I understood I have to use an external module to handle Images and this should be allegro5/allegro_image.h. Than I used al_init_image_addon.
For loading ALLEGRO_BITMAP *img = al_load_bitmap(char *path);
Still, when I verify the var img (if img == NULL)
I get true ever.
Am I missing something?
P.S. Sorry if I have any grammatical mistakes, still relearning english
What are you passing for const char * ?
Is it an image in the directory where you're program is ?
At first I was passing a fully qualified path
C:\way to my image\img.bmp
When it failed I´ve changed to the relative
img.bmp
And the image was side by side with the .exe on Debug folder
I´m programming on Visual Studio 2010
As a Image worths more than words, I will put the code, hope it helps
"Load of \"pic\" image failed \n"
Does it always print this out then ?
I´ve solved the problem
Seems like it doesn´t work with inverted slashes '\' for the fully qualified path.
For the relative, I just was putting on the wrong folder when executing from inside VS (was putting on Debbug, but is the project folder).
Thanks guys.
Please read the wiki article if you haven't. It explains how to do it correctly.