I'm developing a game in Allegro 5.0.8, and everything was going well, until i tried compiling it and running it on Linux (Mint 14)...so i did sime tests;
#include <allegro5/allegro.h>
#include <allegro5/allegro_image.h>
#include <iostream>
int main(void)
{
al_init();
ALLEGRO_DISPLAY *screen = al_create_display(800, 600);
al_init_image_addon();
ALLEGRO_PATH *path = al_get_standard_path(ALLEGRO_RESOURCES_PATH);
al_set_path_filename(path, "players.png");
ALLEGRO_BITMAP *img = al_load_bitmap(al_path_cstr(path, '/'));
if (img == NULL)
std::cout << al_path_cstr(path, '/') << std::endl;
al_draw_bitmap(img, 0, 0, 0);
al_flip_display();
while (true){}
return 0;
}
this example compiles just fine, but the line
ALLEGRO_BITMAP *img = al_load_bitmap(al_path_cstr(path, '/'));
returns NULL. On the other hand, the line
std::cout << al_path_cstr(path, '/') << std::endl;
prints the exact absolute path of the image.
What am i doing wrong?