al_draw_bitmap speed?
Alianix

Just curious does anyone have an idea whether in general al_draw_bitmap or al_draw_bitmap_region is faster if the target bitmap is the same and the source bitmap is the same?

GullRaDriel

Just make a bench you lazy fool.

Alianix

Gosh man you're a genius, but I think you knew that already!

SiegeLord

Let me answer this question with an excerpt from Allegro's source:

#SelectExpand
1/* Function: al_draw_tinted_bitmap 2 */ 3void al_draw_tinted_bitmap(ALLEGRO_BITMAP *bitmap, ALLEGRO_COLOR tint, 4 float dx, float dy, int flags) 5{ 6 ASSERT(bitmap); 7 al_draw_tinted_bitmap_region(bitmap, tint, 0, 0, 8 bitmap->w, bitmap->h, dx, dy, flags); 9} 10 11 12/* Function: al_draw_bitmap 13 */ 14void al_draw_bitmap(ALLEGRO_BITMAP *bitmap, float dx, float dy, int flags) 15{ 16 al_draw_tinted_bitmap(bitmap, solid_white, dx, dy, flags); 17} 18 19 20/* Function: al_draw_bitmap_region 21 */ 22void al_draw_bitmap_region(ALLEGRO_BITMAP *bitmap, 23 float sx, float sy, float sw, float sh, float dx, float dy, int flags) 24{ 25 al_draw_tinted_bitmap_region(bitmap, solid_white, sx, sy, sw, sh, 26 dx, dy, flags); 27}

Alianix

That explains it, thank you Siege

Thread #610497. Printed from Allegro.cc