Widgets Stretching when changing resolution

AshMcConnell

15-10-2010 13:16:29

Hi Folks,

When changing resolution my widgets get stretched (or compressed) depending if I go into a high or lower res

Here it is before at 1280x720



Where I change the resolution to 1280x1024 it looks like this: -



I am using a fairly recent version of MyGUI and the latest version of Ogre from hg.

Any ideas what could be causing the problem? My widgets are all set to pixel widths (i.e. not percentage).

Thanks for your help
All the best,
Ash

AshMcConnell

15-10-2010 13:49:02

It seems that the Window is a different size to the viewport.

The viewport stayed at the previous resolution, whereas the window was changed to the new resolution. I added some debug in OgreRenderManager::windowResized


mViewSize.set(_window->getWidth(), _window->getHeight());
MYGUI_LOG(Info, "Resized Viewport: " << port->getActualWidth() << ", " << port->getActualHeight());
MYGUI_LOG(Info, "Resized Window: " << _window->getWidth() << ", " << _window->getHeight());



Is there some way to make the viewport the correct size when this windowResized method is called (automatically by the renderer?)

Thanks for your help
All the best,
Ash

Altren

15-10-2010 14:00:46

Window resize is usually handled by void Ogre::WindowEventListener::windowResized(Ogre::RenderWindow* _window) call, and MyGUI::OgreRenderManager is WindowEventListener.

You can call OgreRenderManager::setRenderWindow(Ogre::RenderWindow* _window) to force MyGUI update info about screen. And I need to think how to fix that, may be it is Ogre bug. How do you change resolution?

AshMcConnell

15-10-2010 14:05:49

Hi Altren,

Thanks for the reply, I'm using setFullscreen to change the resolution

All the best,
Ash