Fullscreen using incorrect size?

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
petrocket
Gremlin
Posts: 178
Joined: Tue Mar 20, 2007 3:29 am
x 10
Contact:

Fullscreen using incorrect size?

Post by petrocket »

When I start my app up with an ogre.cfg containing

Code: Select all

Full Screen=Yes
Video Mode=1280 x 720
my RenderWindow and Viewport have width/height of 1920x1200 and if I switch fullscreen mode off on my RenderWindow they remain the same size (I just get a title bar).

If I start my app with the following ogre.cfg

Code: Select all

Full Screen=No
Video Mode=1280 x 720
my RenderWindow and Viewport have width/height of 1280x720 and if I turn ON fullscreen then the RenderWindow and Viewport change to 1920x1200 but when I turn fullscreen back off the RenderWindow returns to 1280x720

So, what I expect to happen is if I start my app in Fullscreen mode and then turn off Fullscreen mode I would expect it to become a 1280x720 window, but it doesn't. Any ideas what's going on here?
Ogre API & Manual | Ogre Wiki

blog | website | work

Follow me on twitter @ twitter.com/petrocket
xelon
Halfling
Posts: 91
Joined: Mon Jan 07, 2013 4:24 am
x 13

Re: Fullscreen using incorrect size?

Post by xelon »

I had a problem related to full screen and resolution, but not directly similar to yours. The way I solved it was by altering the camera aspect ratio to the actual viewport height and width.

Code: Select all

 // Alter the camera aspect ratio to match the viewport
	mCamera->setAspectRatio(
		Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
Ludoria now on Kickstarter! Ludoria is now on KickStarter! https://www.kickstarter.com/projects/17 ... g-rpg-game
Ludoria's official website http://www.Ludoria.com
On Facebook https://www.facebook.com/pages/Ludoria/644733108967479
On Twitter https://twitter.com/LudoriaGame
User avatar
LJS
Greenskin
Posts: 138
Joined: Wed Jan 09, 2013 8:58 pm
x 6

Re: Fullscreen using incorrect size?

Post by LJS »

xelong:
// Alter the camera aspect ratio to match the viewport
mCamera->setAspectRatio(
Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
You might want that code into this method too:

Code: Select all

virtual void Ogre::WindowEventListener::windowResized( Ogre::RenderWindow* rw );
Especially if you allow users to change the window(ed) size.

R,
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static
Post Reply