hi all:
how can I load image from external lib (ex. freeimage) in allegro 5?
or
how can I convert a buffer with rgba image data to ALLEGRO_BITMAP?
thanks
al_lock_bitmap with the format set to ABGR_LE is what I use. It expects data bytes for red, green, blue, alpha in that order.
how can I convert a buffer with rgba image data to ALLEGRO_BITMAP?
Here is what I use:
ALLEGRO_FILE* f = al_open_memfile(buffer,size,"r"); ALLEGRO_BITMAP* btmp = al_load_bitmap_f(f,extension); al_fclose(f);
EDIT: Nevermind, it won't work, I actually have whole file in memory, not just rgba image data.