Runtime Fullscreen

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest0067889

Runtime Fullscreen

Post by Guest0067889 »

How can i switch between fullscreen and window mode at runtime?
r3i
Posts: 147
Joined: Wed Jun 29, 2005 10:15 am
Location: Sorrento
Contact:

Hihi!

Post by r3i »

You must set variable fullscreen in createdevice to true.
So ou must destroy the precedent video window created with create device and recreate another!

Tip:
usa a function for alloc and dealloc the device that have several parameters included fullscreen ;)
"We work in the dark, we do what we can, we give what we have, Our doubt is our passion and our passion is our task. The rest: is art of Madness" (H.James)
Guest

Re: Hihi!

Post by Guest »

r3i wrote:You must set variable fullscreen in createdevice to true.
So ou must destroy the precedent video window created with create device and recreate another!
...and then you loose your gamestate? this is closing irrlicht not just the (DX/OGL) render window?

It is not much use to shut down an app to restart it in a different mode - which can easily be done using the registry or options files anyway - it needs to do it on the fly.
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

There are some problems with 'doing it on the fly' though. For example, if you switch from DirectX to OpenGL, your texture formats are different, you'd have to reload all textures. This is why Irrlicht forces you to restart
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

There are some problems with 'doing it on the fly' though. For example, if you switch from DirectX to OpenGL, your texture formats are different, you'd have to reload all textures. This is why Irrlicht forces you to restart
Guest

Post by Guest »

yeah but who mentioned switching renderers? He only mentioned switching display modes which nearly ALL games do on the fly these days.

And I know how it is done in DX as I have my own code that used to do it in my own "engine effort" from yesteryear. Basically if you use system mem for texture you are good to restart - if you use Vram and drop the device you will have to reload them.. this is a given even WITHOUT switching renderers. You look out for lost device, clean up, wait for WM_ACTIVATE, check for device reset, reload all relevent textures/data and carry on. This is ALL in the same instance of the app running and NOT by effectively quitting the app once and having an auto restart from a system command. Quitting and restarting is not "On the fly" and can be done now has I said with configs/reg settings. We need to be able to go from windowed to fullscreen or from 800x600 to 1024x768 with the obvious reload of any assets that will be lost but while keeping the instance of the app (game) running so that all your game data/game states don't get lost.

It CAN be done by editing the irrlicht code (*driver.cpp and irrwin32device.cpp for instance) but is not robust and really needs Nikos code to make it robust and "standard".
r3i
Posts: 147
Joined: Wed Jun 29, 2005 10:15 am
Location: Sorrento
Contact:

Ehy!!!

Post by r3i »

Wait...what are ou talking??
Sorry but I must know.
recreating the device will be lost everithing???
Is the device only the window in wich the scenemanager draws or is the main of the process??
I' don't think so: if recreating device you can loose all, why we don't lose anything with smgr->endScene(); ???

Waiting for reply
"We work in the dark, we do what we can, we give what we have, Our doubt is our passion and our passion is our task. The rest: is art of Madness" (H.James)
Guest

Post by Guest »

We need to be able to go from windowed to fullscreen or from 800x600 to 1024x768 with the obvious reload of any assets that will be lost but while keeping the instance of the app (game) running so that all your game data/game states don't get lost.
Why? Most, if not all games I've seen start in one of two states, windowed or fullscreen. It's simpler to change screen resolution and color depth in a true fullscreen mode than in windowed because you don't have to mess with the OS window handlers... Changing the resolution on a window, at least in MS, requires a change of the desktop , a global parameter. I'm pretty sure it's the same in a Linux ssytem as well.

I've never seen a game where the user can switch from OGL to DX "on the fly" without a restart of some kind.
Post Reply