Taking a screenshot in allegro?
Is there a function that will allow me to save a bitmap as whatever the display is currently showing?... possibly something like ALLEGRO_BITMAP *screenshot = "al_get_display_bitmap(display)") I've looked through the manual and nothing is catching my eye. I figured someone would know. Basically I want to copy the pixels currently being displayed to a bitmap.
You can use al_save_bitmap("something.png", al_get_display_backbuffer(display));. It will be slow though but no avoiding that. It also might not work on some OpenGL ES (mobile) devices.
EDIT: Make sure you do it after drawing and BEFORE flipping.
Oh okay thanks. If it is too slow, I will just make a buffer instead. I've been using the display's backbuffer by default.
Thread #613006. Printed from Allegro.cc
A buffer won't be any faster. It probably won't be too slow anyway. Just not as fast as when not using hardware acceleration.