Device in fullscreen 16:9
-
- Posts: 19
- Joined: Mon Apr 13, 2009 5:42 pm
Device in fullscreen 16:9
How to make Irrlicht working with 16:9 output?
-
- Posts: 168
- Joined: Sun Feb 04, 2007 3:30 pm
- Location: France
-
- Posts: 19
- Joined: Mon Apr 13, 2009 5:42 pm
When I create device with a different resolution in fullscreen, irrlicht crash.
Code: Select all
dimension2d<s32> tmpRes;
tmpRes.Width=1024;
tmpRes.Height= floor(tmpRes.Width/16*9);
device = createDevice(tmpDriver,tmpRes,tmpBits, true,true,true,&events);
just my 2 cent:
might be equal to:
try
or better
Code: Select all
tmpRes.Height= floor(tmpRes.Width/16*9);
Code: Select all
tmpRes.Height= floor(tmpRes.Width/ (16*9) );
Code: Select all
tmpRes.Height= floor((tmpRes.Width/16)*9);
Code: Select all
tmpRes.Height= floor((tmpRes.Width*9)/16);
-
- Posts: 19
- Joined: Mon Apr 13, 2009 5:42 pm
There is a difference, however, betweenGendo Ikari wrote:All lines have the same meaning. X*Y/Z = (X*Y)/Z = X*(Y/Z) = X*Y*(1/Z).
However thank you, i've tried but same error
X/(Y*Z) and (X/Y)*Z. You want to multiply the width by 9 and then divide it by 16. Because the ration is Width/Height = 16/9. Solve for wight and you get (9 * Width)/16 = Height. I think the order of operations in this case may have made it work out, but it's worth a try, anyway.
I suppose you can only use resolutions which are actually offered by the system. So probably the resolution you try does not exist.
Still it shouldn't crash imho... that sounds wrong. But I can reproduce it on Linux - or well, due to the difficulty of debugging fullscreen I'm not even sure what exactly happens as all I get is a messed up screen and the only way to get rid of it was restarting X *sigh*. Can't do more tests right now due to missing time.
On which system did you test?
Still it shouldn't crash imho... that sounds wrong. But I can reproduce it on Linux - or well, due to the difficulty of debugging fullscreen I'm not even sure what exactly happens as all I get is a messed up screen and the only way to get rid of it was restarting X *sigh*. Can't do more tests right now due to missing time.
On which system did you test?
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
I agree with CuteAlien. You should not try to set a fullscreen resolution that you graphics card does not support. You could either
- use a fixed value (e.g. 640x480) or
- use IrrlichtDevice::getVideoModeList to find out which fullscreen resolutions your graphics card supports
I use the second method and a lot of modes that my notebook supports are unsupported by my desktop.
- use a fixed value (e.g. 640x480) or
- use IrrlichtDevice::getVideoModeList to find out which fullscreen resolutions your graphics card supports
I use the second method and a lot of modes that my notebook supports are unsupported by my desktop.
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
-
- Posts: 19
- Joined: Mon Apr 13, 2009 5:42 pm
Thank you very much, i think this: IrrlichtDevice::getVideoModeList, its foundamental!
I'll test.
My development environment its a WinXp SP3 with Ati 4850, compiled with CodeGear Rad Studio 2009.
EDIT:
But getVideoModeList is a method of IrrlichDevice. So do i need to create device with a standard resolution, than check video mode, and than destroy and create again device?
I'll test.
My development environment its a WinXp SP3 with Ati 4850, compiled with CodeGear Rad Studio 2009.
EDIT:
But getVideoModeList is a method of IrrlichDevice. So do i need to create device with a standard resolution, than check video mode, and than destroy and create again device?
-
- Posts: 19
- Joined: Mon Apr 13, 2009 5:42 pm
It doesn't matter. You just create a null device instance so that you can get the video mode list without creating an Irrlicht window. Once you've got the video mode list, you can destroy the null device and create a D3D or OpenGL device.Gendo Ikari wrote:Is a null-device expensive regard memory and cpu?
Travis
@Gendo Ikari: I don't use the NULL device in that place. Before starting my game the user gets a window where he can choose the resolution (and the options for device creation) that is always started with the Software Renderer.
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
-
- Posts: 19
- Joined: Mon Apr 13, 2009 5:42 pm