switch FULLSCREEN on and off
I'm currently trying to implement a fullscreen on/off function on my allegro game. It basically consists of destroying the current display and generating a new one in fullscreen mode, or in the game's native resolution if it already was in fullscreen mode.
The problem is, once I activate the function, images drawn before the new display was created can't be displayed, so I get a black screen. So I have to redraw every bitmap needed for the portion of the game I'm in for it to behave normally.
I looked in the allegro manual, but I couldn't find the answer I was looking for. Is this problem unavoidable ?
here's the relevant portion of my code:
If you are using a fullscreen window you can switch between fullscreen and windowed without having to destroy anything, eg:
// toggle fullscreen
al_set_display_flag(display, ALLEGRO_FULLSCREEN_WINDOW, !(al_get_display_flags(display) & ALLEGRO_FULLSCREEN_WINDOW));
Thread #617152. Printed from Allegro.cc
Ok thank you a lot, you reduced a non-working 25 lines function to a beautiful single line of code