Page 1 of 1

Changing resolution

Posted: Wed Mar 10, 2004 10:00 pm
by PadrinatoR
Hi!
How can I change the screen resolution, fullscreen/windowed mode and other stuff set calling createDevice, during the game??

Posted: Wed Mar 10, 2004 11:22 pm
by Honkey Kong
Not too sure if you can change the values of the device as it is running... I'm assuming you are wanting to do this for menus and stuff, correct me if I am wrong. I believe it would probably be easier and more efficient to just clear the device out and create a new one with the different values. You should be able to store any other data in memory while you change devices, much like the Irrlicht techdemo does. Again, I'm not sure if this would work. I've been up for a couple of days straight and I'm hard wired on caffeine. Your mileage may vary.

Posted: Thu Mar 11, 2004 11:20 am
by Masdus
you can't change these settings for a running device. The best way is to make sure all the needed data is saved, release the device and then create a new one with the new setting. May games acutally work this way which is why they often pause when you change a resolution setting. Another option is to not have these options within your game, but have a utility that runs before the game to allow for them

Posted: Thu Mar 11, 2004 1:03 pm
by PadrinatoR
:( Then I will release my device and create another one. Thank you ;)

Posted: Thu Mar 11, 2004 6:07 pm
by mq
Wouldn´t it be possible to implement a function to the engine like changeDevice()?
May games acutally work this way which is why they often pause when you change a resolution setting.
That´s what I want to avoid.

greets,
mq

Posted: Thu Mar 11, 2004 9:03 pm
by AlexL
- It is now possible to make the drawing window resizeable, if it is in windowed mode.
Use IVideoDriver::setResizeAble(true) to do this.
This is listed in the change for version 0.6 so it might be possible to look through the script whrere this is defined and use some of the code from there to make your own class for expanding it to pre-defined sizes by you.

Posted: Thu Mar 11, 2004 9:37 pm
by mq
You are right, it would probably be a possibility. But a function to change values like fullscreen, bitdepth, and the other dx/opengl parameters at engine-runtime would be very nice :D
You can write your own function, I know, and it is not really important, but neverthless it would be nice :D

greets,
mq

Posted: Fri Mar 12, 2004 2:09 am
by Honkey Kong
mq wrote:Wouldn´t it be possible to implement a function to the engine like changeDevice()?
May games acutally work this way which is why they often pause when you change a resolution setting.
That´s what I want to avoid.

greets,
mq
Unfortunately, there's not much you can do regarding this little change, because the monitor has to switch resolutions/refresh rates when the device resolution changes, so the most efficient way to do this would be to pause the game, drop the device, and create a new one with the fresh parameters. God only knows what kind of chaos would be caused if you tried changing this stuff mid-game. :?

Posted: Sun Mar 14, 2004 4:42 pm
by mq
Of course it would be possible. It is only a matter of the way how you do it. But maybe it is also depending from the engine. If the different layers of the engine (video, scene,...) are independent written, it is no problem to change resolution, parameters, etc without loading the whole game again ;)

greets,
mq

[edit]
Of course in the end you delete and create a new device. But the point is that it should not affect any other parts of the engine so you can easily write a function "changeResolution()" or so

[edit2]
Many games that are not based on the Q3 engine can do change any parameters without loading the whole game again :D