Resizing device window and 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
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Resizing device window and resolution?

Post by 3DModelerMan »

Is there any way I can change the video mode of the irrlicht device? I'm writing an editor using win32, and the resolution is terrible. It's all stretched and pixelated. Should I just create the device at the maximum screen resolution?
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Resizing device window and resolution?

Post by serengeor »

Have you used irr::video::IVideoDriver::setViewPort? if so, maybe you just made it bigger than the actual device resolution?
(asking out of curiosity :roll:)
Working on game: Marrbles (Currently stopped).
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Re: Resizing device window and resolution?

Post by 3DModelerMan »

No I never used setViewPort.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Resizing device window and resolution?

Post by greenya »

3DModelerMan wrote:Is there any way I can change the video mode of the irrlicht device? I'm writing an editor using win32, and the resolution is terrible. It's all stretched and pixelated. Should I just create the device at the maximum screen resolution?
In my wrapper in L04.ParticleEmitterViewer example i had similar situation. I had a control which is Irrlicht device, i embedded it into my UI. So the problem was only when i resize irrlicht control (using its HWND) it resizes outside, but inside Irrlicht it doesn't update the resolution. But i know that it can do it, because in Irrlicht' 05.UserInterface example we see resizeable window.

I solved it by notifying Irrlicht device with the resize i just made, so it is (for example):

Code: Select all

core::dimension2du d = core::dimension2du(400, 300);
m_VideoDriver->OnResize(d);
// now irrlicht internally ajusted device's resolution, but active camera will not update its aspect ratio automatically (which is OK, because you may no need it), so if you want the camera to be OK after this resize, you need to write also something like:
m_SceneManager->getActiveCamera()->setAspectRatio((float)d.Width/d.Height);
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Re: Resizing device window and resolution?

Post by 3DModelerMan »

Thanks. That's just what I needed.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
NemoStein
Posts: 17
Joined: Mon Aug 11, 2008 12:04 am

Re: Resizing device window and resolution?

Post by NemoStein »

I'm really sorry for the necro, but I need to!

The strange thing about setting the aspect ratio of the camera is that when you rescale the window on the sides the content keeps the same size, so more content can be viewed on the sides (or less, if you make it smaller).
But if you resize it vertically the content scales together, so, no more (nor less) content can be viewed on the top/bottom side of the screen.

ScreenShot to explain...
This is how it works:
Image

And this is what I want to achieve:
Image

Any thoughts?

[EDIT]
I've just realized that this mess with the FOV somehow...
What I really need is a to allow the user to rescale the window to see more (or less) of it's contents...
Post Reply