[A5] Changing window flags
Hey, how would I go by changing the window flags while the program is running?
Right now, the program is operating in fullscreen mode, but I want the user to be able to push F1 to switch between Windowed || Fullscreen mode.
I tried this, but it didn't seem to work;
al_set_new_display_flags(ALLEGRO_WINDOWED || ALLEGRO_FULLSCREEN);
3 //handle key presses
You need al_toggle_display_flag(display , ALLEGRO_FULLSCREEN_WINDOW , fullscreen = !fullscreen); Or you can destroy and recreate the display. But that means converting bitmaps to be compatible with the new display or reloading everything.
Thread #614575. Printed from Allegro.cc
Allegro 5.1 is supposed to do the bitmap conversion automatically for you, but with 5.0 you have to do it manually, using al_clone_bitmap. You don't need to do this when using the "fullscreen window" mode, though.