I use 'working bitmaps' for quite a lot of my effects - for example, merging overlapping primitives before drawing them with reduced opacity:
al_draw_filled_rectangle( 0, 0, 20, 20, al_map_rgb_f(1,0,0));
al_draw_filled_rectangle( 0, 10, 20, 30, al_map_rgb_f(0,1,0));
al_draw_filled_rectangle(10, 0, 30, 20, al_map_rgb_f(0,0,1));
al_draw_tinted_bitmap(tmp, al_map_rgba_f(1,1,1,0.5), 0, 0);
Here, tmp needs to be cleared to 100% transparency before each draw. The most trivial way of doing this would be:
Alternatively, I could blank the area needed with a rectangle:
So, let's say I made the (perhaps poor) decision to clear a working area many times in my draw code. Given that al_clear_to_color ignores blending and transforms, I'm wondering whether it might be better-optimised than the primitives, despite the larger fill area.
Could someone with knowledge of Allegro's internals give me a hint as to what might be universally faster?