resizing Ogre Viewport interfers with CEGUI
Posted: Sun Feb 15, 2009 12:00
Hi,
my problem is as follows: When the players opens some ingame Windows (inventory, Character info etc), they use up about 50% of the screen (left or right side). So half of the game world is blocked from the players view.
I got the proposal, that if such a window is opened and covers for example the left side of the screen, I should change the viewport, so that the game world is rendered only to the right side. By doing so, you should be able to continue playing (though with reduced sight) when some windows are opened.
The code is simple:
What happens is: CEGUI renders to the reduce viewport, so that the window that should cover the left is placed on the right, too. It seems that changing the viewport affects CEGUI as well.
My code of the creation of the cegui_renderer:
This is done before the viewport is created. I have no Idea how CEGUI choses its viewport for rendering.
Please give me some advice.
Thanks alot.
my problem is as follows: When the players opens some ingame Windows (inventory, Character info etc), they use up about 50% of the screen (left or right side). So half of the game world is blocked from the players view.
I got the proposal, that if such a window is opened and covers for example the left side of the screen, I should change the viewport, so that the game world is rendered only to the right side. By doing so, you should be able to continue playing (though with reduced sight) when some windows are opened.
The code is simple:
Code: Select all
m_viewport->setDimensions(0.5,0,1,1);
m_camera->setAspectRatio(Ogre::Real(m_viewport->getActualWidth()) / Ogre::Real(m_viewport->getActualHeight()));
What happens is: CEGUI renders to the reduce viewport, so that the window that should cover the left is placed on the right, too. It seems that changing the viewport affects CEGUI as well.
My code of the creation of the cegui_renderer:
Code: Select all
CEGUI::OgreCEGUIRenderer(
m_window,
Ogre::RENDER_QUEUE_OVERLAY,
false,
3000,
m_scene_manager);
This is done before the viewport is created. I have no Idea how CEGUI choses its viewport for rendering.
Please give me some advice.
Thanks alot.