Changing resolution

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
PadrinatoR
Posts: 50
Joined: Tue Mar 09, 2004 9:53 pm
Location: Spain

Changing resolution

Post by PadrinatoR »

Hi!
How can I change the screen resolution, fullscreen/windowed mode and other stuff set calling createDevice, during the game??
There are only 10 types of people: those who understand binary and those who don't

--------------------------------------------

Image
Honkey Kong
Posts: 16
Joined: Mon Jan 12, 2004 4:31 am
Location: USA
Contact:

Post 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.
Image
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post 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
PadrinatoR
Posts: 50
Joined: Tue Mar 09, 2004 9:53 pm
Location: Spain

Post by PadrinatoR »

:( Then I will release my device and create another one. Thank you ;)
There are only 10 types of people: those who understand binary and those who don't

--------------------------------------------

Image
mq
Posts: 8
Joined: Wed Nov 26, 2003 4:04 pm
Location: Heidelberg, Germany
Contact:

Post 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
[Knowledge is king] ;-)
AlexL
Posts: 184
Joined: Tue Mar 02, 2004 6:06 pm
Location: Washington State

Post 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.
mq
Posts: 8
Joined: Wed Nov 26, 2003 4:04 pm
Location: Heidelberg, Germany
Contact:

Post 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
[Knowledge is king] ;-)
Honkey Kong
Posts: 16
Joined: Mon Jan 12, 2004 4:31 am
Location: USA
Contact:

Post 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. :?
Image
mq
Posts: 8
Joined: Wed Nov 26, 2003 4:04 pm
Location: Heidelberg, Germany
Contact:

Post 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
[Knowledge is king] ;-)
Post Reply