i also included allegro_image.h and lib but al_load_bitmap("asd.bmp"); crashes. the image file is in the same directory.. No problem at loading but when i try to draw the bitmap, it crashes :/
Did you call al_init_image_addon first?
Also, how are you drawing the bitmap?
al_load_bitmap() must have returned null due to either not calling al_init_image_addon() or the program not running in the directory you think it is.
okay one more question
ALLEGRO_BITMAP *tempo; tempo=al_load_bitmap(filename); for (int i=0;i<Imgn;i++) { Image.push_back(al_create_sub_bitmap(tempo,(i*Imgw),0,Imgw,Imgh)); } al_destroy_bitmap(tempo);
this code gives assertion (void*)0 error.
You forgot to check al_load_bitmap for failure.
when i remove destroy code, it works correctly. so how to remove temporary bitmap ?
From the manual:
Note that destroying parents of sub-bitmaps will not destroy the sub-bitmaps; instead the sub-bitmaps become invalid and should no longer be used.
Don't destroy the parent bitmap before you are done with the sub-bitmaps.
uhh then i will define another vector that contains images..
or current vector's first element will be main image for animated images