![]() |
|
al_load_bitmap crash ?! |
xantier
Member #12,521
January 2011
|
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 :/ |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Did you call al_init_image_addon first? Also, how are you drawing the bitmap? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Matthew Leverton
Supreme Loser
January 1999
![]() |
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. |
xantier
Member #12,521
January 2011
|
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. |
Thomas Fjellstrom
Member #476
June 2000
![]() |
You forgot to check al_load_bitmap for failure. -- |
xantier
Member #12,521
January 2011
|
when i remove destroy code, it works correctly. so how to remove temporary bitmap ? |
Matthew Leverton
Supreme Loser
January 1999
![]() |
From the manual: Quote: 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. |
xantier
Member #12,521
January 2011
|
uhh then i will define another vector that contains images.. or current vector's first element will be main image for animated images |
|