|
Fullscreen and windowed - Is it my app or an Allegro bug? |
Lucas Dalmasso
Member #20,839
August 2021
|
Hi, im programming an app that needs switching to full screen and back to windowed mode in real time for Windows. I have tried al_destroy_menu() and reassign it with al_build_menu() and al_set_display_menu() but no luck, the program frezees. Any idea why this could be hapenning? Thxs in advance. |
DanielH
Member #934
January 2001
|
Not sure you can. In full screen mode, your client area becomes the desktop. |
Lucas Dalmasso
Member #20,839
August 2021
|
But i don't get it. How to do that? Sorry my knoob knowladge. |
DanielH
Member #934
January 2001
|
It's not a bug. That's how fullscreen works. {"name":"613364","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/2\/92eff01e684eeae02f281dc9eb73fab5.png","w":549,"h":440,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/2\/92eff01e684eeae02f281dc9eb73fab5"} In windowed-mode, you have 2 parts: In fullscreen-mode, the client area fills the entire viewing area. Hence, no menu bar. |
AceBlkwell
Member #13,038
July 2011
|
Lucas, Sound like what I normally discover with my questions, “You can’t get there from here.” If I understand correctly, you start in window mode which includes menus. At some point you go to Fullscreen where you lose the menus due to fullscreen not needing them. I think that’s what Daniel is saying. When you revert back to window mode, the menus no long available. If this is the case, maybe you could treat the screen modes independently. Opt 1 (default) is Windowed. Opt 2 is Fullscreen. If you need to revert back to Opt 1 you would basically restart like it was first time through. Any shared data between the two modes could be placed in a set of variables such as a structure or array of bool flags etc. And if I have total misunderstood, then…. Nevermind - Emily Litella (Gilda Radner SNL) |
Lucas Dalmasso
Member #20,839
August 2021
|
Yeah, i was doing bad. So i have to put as you say in a separate thing my vars. |
torhu
Member #2,727
September 2002
|
I have a game that can switch between windowed and fullscreen modes. It doesn't use menus or audio streaming, so it just pauses timers before doing the switch. After the switch it restarts the timers, redraws the screen, flushes the event qeueue, and clears the state of the controls before continuing. Same as the pause mode, except it doesn't wait for the user to do anyting before continuing. It sounds like you would also need to pause the audio stream with al_set_audio_stream_playing, then restart the audio stream before continuing the game loop. And something similar with the menu, but I have no experience with that. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Lucas Dalmasso said: I have tried al_destroy_menu() and reassign it with al_build_menu() and al_set_display_menu() but no luck, the program frezees. Try destroying the menu before destroying the display, and then if you can't attach a new menu to a window, that is a bug. File an issue on Github. 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 |
Lucas Dalmasso
Member #20,839
August 2021
|
"Try destroying the menu before destroying the display, and then if you can't attach a new menu to a window, that is a bug. File an issue on Github." Yes, what you say works in Windows but not linux. When i add ALLEGRO_GTX_TOPLEVEL to "al_create_display()" the app closes with an "exception. core dumped". |
Edgar Reynaldo
Major Reynaldo
May 2007
|
If you haven't already, please file an issue on github. 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 |
|