|
[A5] Changing window flags |
Matias Persson
Member #15,093
May 2013
|
Hey, how would I go by changing the window flags while the program is running? I tried this, but it didn't seem to work; 1if(ev.type == ALLEGRO_EVENT_KEY_DOWN)
2{
3 //handle key presses
4 switch(ev.keyboard.keycode)
5 {
6 case ALLEGRO_KEY_F1:
7 {
8 al_set_new_display_flags(ALLEGRO_WINDOWED);
9 }
10 break;
11 }
12}
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
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. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Matias Persson
Member #15,093
May 2013
|
Thanks. |
torhu
Member #2,727
September 2002
|
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. |
|