Page 1 of 2

toggle fullscreen / window mode

Posted: Fri Jan 02, 2004 11:37 pm
by morlok
please help!!!

Is it possible to switch from Windowed mode to fullscreen AT RUN TIME??
and how?

it's a very usefull feature (ex: alt-Enter toggle fullscreen/window)
but il doesn't seem to be very easy to implement with that engine... :-(

Posted: Sat Jan 03, 2004 2:30 am
by qwe
you should be able to do this with an event receiver: just close the device when alt-enter is pressed, and immediately create a new, windowed device.

of course, this may affect other things within the engine as well :roll:

Posted: Sat Jan 03, 2004 10:13 am
by morlok
yes it works ;-)

thanks!

Posted: Thu Jan 08, 2004 3:21 pm
by qwe
just remember to save the state of the game before dropping the device :wink:

Posted: Fri Jan 30, 2009 7:21 pm
by tewe76
Come back to life, my creature!!! :P
A very old thread, i know, but i've exactly the same question:
is there a way to toggle windowed/fullscreen on runtime?
Answer on 2004: just close the device and immediately create a new, windowed device.
Answer on 2009, with IrrLicht 1.5? There's no automatic method to toggle without losing the scene?

Posted: Fri Jan 30, 2009 7:21 pm
by hybrid
No, that's not possible.

Posted: Fri Jan 30, 2009 7:27 pm
by tewe76
OMG! Were you spying me?!!! :shock: Answered in seconds! :wink:

I've a question, then: if i close the device, do i have to reload the meshes, textures, etc?

Posted: Fri Jan 30, 2009 8:43 pm
by Spkka
just remember to save the state of the game before dropping the device Wink

Posted: Sat Jan 31, 2009 6:17 am
by tewe76
Yes, i've read that, but i were not sure if "the state of the game" were meshes and so, or only your own logic and variables. I suppose you have to reload everything, just as you had restarted the application. Thanks.

Posted: Sat Jan 31, 2009 11:06 am
by Spkka
It depends of course "when" you decide to switch fullscreen/windowed mode. If its in the middle of the game you still want your character to be on the same place etc imo.

I still need to implement it myself so it would be nice if you post your solution on the forum for others to read maybe ;)

Posted: Sat Jan 31, 2009 7:49 pm
by arras
For sure you already noticed that most of the games which offer you fullscreen/windowed mode switch will tell you that you need to restart application for changes to take place. That is not bad solution ...or compromise better say.

You can also offer setting screen on application start where user can change settings like that and do some other things as well (open manual/help, visit webpage, view version and so on). This will have device of its own which will close after play/continue/start button is clicked. Then application device will be created based on settings selected.

Posted: Sat Jan 31, 2009 8:10 pm
by tewe76
You can also offer setting screen on application start where user can change settings like that
Yes, i'm probably going that way. In fact, that was my first idea :wink:

Posted: Tue Feb 03, 2009 12:37 pm
by burningreggae
The new example 21. Quake3Explorer does exactly that. It opens and closes a Device and saves/reload the game state. It even provides a GUI for changing the ScreenResolution.!

Posted: Tue Feb 03, 2009 2:29 pm
by tewe76
The new example 21. Quake3Explorer does exactly that. It opens and closes a Device and saves/reload the game state. It even provides a GUI for changing the ScreenResolution.!
Don't f*ck! (spanish expression, don't know if it exists in english :wink: )
That's cool, i'll take a look on it 8)
The only thing left, then, is to detect ALT+TAB or similar. Or is there a solution for that? Maybe "device->isWindowActive" or "device->isWindowFocused" have something to do? I really don't understand well the diference...

Posted: Mon Feb 09, 2009 9:51 pm
by christianclavet
I was able to do it one way on 1.4. It should work again in 1.5.

I opened my main device on the "null" device. You will see nothing opening (no window or display).

In your code then you open another device (GL or DX) then you draw your scene on that device.

You have to take care after to close ALL devices, because the application will still be running even if you closed the display.