Resizing device window and resolution?
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Resizing device window and resolution?
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
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Re: Resizing device window and resolution?
Have you used irr::video::IVideoDriver::setViewPort? if so, maybe you just made it bigger than the actual device resolution?
(asking out of curiosity )
(asking out of curiosity )
Working on game: Marrbles (Currently stopped).
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Re: Resizing device window and resolution?
No I never used setViewPort.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Re: Resizing device window and 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.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?
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);
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Re: Resizing device window and resolution?
Thanks. That's just what I needed.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Re: Resizing device window and resolution?
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:
And this is what I want to achieve:
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...
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:
And this is what I want to achieve:
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...