Does al_load_bitmap_f work
Niunio

Initially I thought it was a problem with Allegro.pas, but I did some testing with C and I have the same problem: it returns NULL.

I'm using Linux Xubuntu 16.04.3 updated and latest Allegro 5.2.3.

To reproduce the problem, get the ex_bitmap.c example and just add this at the beginning:

  ALLEGRO_FILE *lFile = NULL;

Then search the line "bitmap = al_load_bitmap(filename);" and change it:

/*
    bitmap = al_load_bitmap(filename);
 */
    lFile = al_fopen (filename, "r");
    bitmap = al_load_bitmap_f (lFile, filename);
    al_fclose (lFile);

AFAIK it should work, but it didn't. Debugging with GDB it says in function al_load_bitmap_flags_f that "h" is NULL. Didn't look deeper.

Bruce Perry

Judging by a quick look at the source, the string argument should no longer be the filename, but the result of al_identify_bitmap or al_identify_bitmap_f - possibly the file extension but I'm not sure. Does that help?

[EDIT]
Yep, canonical extension with dot - see here.

Niunio

Did a test (in Pascal) and didn't work. I can't do the test in C now but I will.

[edit]
Tested in C and it works. Then I find the problem with Pascal: the destination buffer pointer wasn't used properly. Now it works. :)
[/edit]

Anyway, the problem seems that Mr. Silly Me didn't read the documentation. ::)

Thread #617136. Printed from Allegro.cc