Changing resolution in fullscreen - a possible cheat

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
EvilDavo
Posts: 17
Joined: Sun Sep 27, 2009 12:20 pm
Location: Australia

Changing resolution in fullscreen - a possible cheat

Post by EvilDavo »

Hi

I was a bit frustrated by the fact that irrlicht can't change resolution in fullscreen mode without having to reload all irrlicht objects and resources. This includes textures and stuff which on a complex project would mean a long wait to reload. There must be a better way I thought.

So,

1) is it possible to cheat (in fullscreen mode), by
rendering at a lower resolution than the desktop resolution
then scale up to fit the entire screen.
e.g. I might have a 1680x1050 desktop res, but I want to play my
game in 1024x768.

(I suppose RTTs would work, but I'm not sure how widely supported
they are nowadays, so I'm hesitant to use them for the job)

2) for that matter, how can I resize the window in windowed mode?
Is there something like resizeWindow( dimension2di(1024, 768) );
I can't seem to find it if there is.

Thanks.
CuteAlien
Admin
Posts: 9926
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

For 2) I guess you could try using the system-specific functions (for example Windows API). We do not have a platform independent wrapper for that so far.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
EvilDavo
Posts: 17
Joined: Sun Sep 27, 2009 12:20 pm
Location: Australia

Post by EvilDavo »

could those system-specific functions also work in fullscreen mode?
There must be some way that modern games can do this so effortlessly.

I guess I could always make a setup program as a seperate executable for configuring game settings that can't be configured in run-time. Feels somewhat dodgy to do so, but the alternatives are a pain.
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

most games do this in some kind of options page, which has very few objects to re-load. I don't know whether they work by re-creating the scene or not, but it's certainly possible to mimic this behaviour by deleting & re-making the device. For simple scenes the delay will be minimal.
RTTs are well supported, so that solution will work (but is not ideal)
Nalin
Posts: 194
Joined: Thu Mar 30, 2006 12:34 am
Location: Lacey, WA, USA
Contact:

Post by Nalin »

ArmA 2 can be configured like option #1. It has separate values for the window resolution and the render resolution. It then scales the render resolution up or down to match the game's window resolution.

But really, the feature you want is only in DirectX 10 and up. DirectX 9 games have always either reloaded everything when you changed certain settings, or required you to restart the game before they take affect. There is not much you can do about it.
EvilDavo
Posts: 17
Joined: Sun Sep 27, 2009 12:20 pm
Location: Australia

Post by EvilDavo »

DavidJE13 wrote:most games do this in some kind of options page, which has very few objects to re-load. I don't know whether they work by re-creating the scene or not, but it's certainly possible to mimic this behaviour by deleting & re-making the device. For simple scenes the delay will be minimal.
RTTs are well supported, so that solution will work (but is not ideal)
Hmm... the RTT method does seem like a cheat.

Well, a game/program will always have the need to support saving/loading, so maybe I could use serialization to do that...

I could save the entire game, destroy the menu and game objects, delete the device, recreate it, recreate the objects, then reload the game. That must be how the professionals do it. Such a complex way to do something that should be simple. Oh well.. you get that.

Thanks for the advice.
devsh
Competition winner
Posts: 2049
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

changing resolution and window size should be no problem in openGL....

irrlicht already supports the Window resize

people... just restart the IVideoDriver
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Windowed mode and fullscreen can be fundamentally different. E.g. the usage of vsync may only work in fullscreen mode. So you cannot simply change the resolution to get fullscreen mode. This would only be a fake, which might also run slower than real fullscreen mode.
A window resize method should be possible in the future, though. We just have to be sure that the change propagation works correctly on all systems.
Post Reply