Image doesn't load
Hrod Ruck

I'm trying to load an image from the same folder my main is and I'm always getting null. I've tried moving the image to the folder my .exe is and it did not help. I'm using windows, by the way. Code excerpt:
bouncer = al_load_bitmap("image.png");
if (!bouncer)
fprintf(stderr, "failed to create bouncer.\n");
al_destroy_display (display);
return -1;
If the full code is needed, I will post it here as well.
Also, I'm tring to get the path using

path = al_get_standard_path(ALLEGRO_RESOURCES_PATH);
printf("%s", al_path_cstr(path, '/'));
but the program is crashing.

l j

If you're running from an IDE, the IDE may change your working directory.

Use al_get_standard_path with al_change_directory to change the working directory.

Hrod Ruck

Thanks, but how do I print the path I'm using? I don't know which path is ALLEGRO_RESOURCES_PATH, for instance.
The program is causing a seg fault when I try to change directory (I opened another thread for that)
And loading a .bmp image does not help

Matthew Leverton
Hrod Ruck

Thanks to all for your help. I wasn't setting al_init_image_addon, probably

Thread #613667. Printed from