What is the fastest way to draw a large bitmap?
I am making a game where you can scroll around a bitmap. I can play it fine on my i7 computer just fine up to a certain size. Then things get really slow. I have tried to get it running on a raspberry pi, but it is too slow to be playable even on the smallest size of bitmap. I have tried using a function called al_hold_bitmap_drawing() when I draw the large scrollable bitmap, but it only helped slightly.
If you're going to need a large tile map (that is too big to be a video bitmap), then you're going to need to break it up into individual textures. Find the max texture size and create as many textures that size as you need to cover the tile or background map.
So, the algorithm I would use is something like this :
int NTWIDE = map->W()/MaxTextureWidth() + (map->W()%MaxTextureWidth())?1:0;
int NTTALL = map->H()/MaxTextureHeight() + (map->H()%MaxTextureHeight())?1:0;
Texture* TEXARRAY = new Texture[NTWIDE*NTTALL];
for each TEX in TEXARRAY :
BLIT(MAP , x , y , MaxTextureWidth() , MaxTextureHeight() ,
TEX , 0 , 0 , MaxTextureWidth() , MaxTextureHeight())
Thread #617091. Printed from Allegro.cc
Use al_get_display_option with ALLEGRO_MAX_BITMAP_SIZE as the option parameter to see how big a hardware accelerated bitmap may be.