Guess I'll have to produce a test case then
I did some debugging. al_clone_bitmap returns null because it calls al_lock_bitmap, which calls al_lock_bitmap_region, which contains this piece of code:
Kind of embarrassing for me, don't you think? My collision testing code locks the bitmaps before using al_get_pixel on them, but didn't always unlock them. My original toggle_fullscreen_mode() function works fine after all, cloning the bitmaps once is enough.
Thanks for trying to help, guys
I have a bonus question: After toggling fullscreen, I would like to redraw the last frame. The menu screens in the game are just static images being drawn once, which means that the screen turns black after toggling the fullscreen mode. There is no way to get a copy of the front buffer, right?