What do you exactly mean with "At the beginning of your frame .... you just created"?
I honestly can't figure out what you mean with targeting a bitmap.
I mean that, at the beginning of the rendering code of your game loop, you have to set the target bitmap to the black bitmap you created before. In Allegro (and in most somewhat up-to-date graphics APIs) you can not only render graphics to the window/screen, but also onto another texture. In the case of Allegro, this is represented with the bitmaps. You can render things onto bitmaps and then use these bitmaps for further rendering or whatever. You can set the target bitmap with
Just pass your black bitmap to this function.
Next, how do I clear a bitmap to color?
After calling the function I mentioned above, just call
al_clear_to_color(al_map_rgba_f(0.0f, 0.0f, 0.0f, 1.0f));
This function always clears the bitmap which is currently the target bitmap.
And last but not least, how do I set a target bitmap to the regular backbuffer, and how do I draw the bitmap on the backbuffer?
There are two ways to reset the target bitmap to the backbuffer. You can either do
or, as a simplified version,
Just pass your display to whatever method you prefer. After calling one of those two functions, just call any draw function to render the bitmap onto the backbufer. For example:
void al_draw_bitmap(ALLEGRO_BITMAP *bitmap, float dx, float dy, int flags);