You might find al_create_sub_bitmap useful here. It has GPU advantages since internally Allegro can tell the GPU to do loads of draw operations from the same texture instead of many different ones.

By the way, Elias, wouldn't all platforms initialise memory to zero upon first handing it to a process, for security reasons? And then all platforms would leave it uninitialised if reallocating it when it already belonged to the process in the past (since the OS isn't even involved at this stage)?

[edit:] Specifically, al_create_bitmap() will create an uninitialized bitmap, you have to clear it for it to become 0 and not random memory.

Even if that's the OS case, that doesn't seem like it should be Allegro's case. If it's not a huge performance reason, we should probably default to calling clear_to_color inside al_create_bitmap. Returning a completely different bitmap state on a different OS sounds like it should be a different function name.

-----sig:“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs