resizing Ogre Viewport interfers with CEGUI

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Lastmerlin
Not too shy to talk
Not too shy to talk
Posts: 33
Joined: Sat Mar 08, 2008 17:25

resizing Ogre Viewport interfers with CEGUI

Postby Lastmerlin » 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:

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Feb 16, 2009 10:00

Hi,

I think CEGUI will target all viewports for the scene manager that it's hooked into. You could try messing about with >1 scene manager, or alternatively, disable overlays during the rendering phases where yo do not want CEGUI to be drawn.

This whole deal is a little shitty to be honest. Hopefully my next attempt will be better :lol:

CE.

Lastmerlin
Not too shy to talk
Not too shy to talk
Posts: 33
Joined: Sat Mar 08, 2008 17:25

Postby Lastmerlin » Tue Feb 17, 2009 12:20

Hmm I think I will add this feature request to the *we'll deal with this later - eventually* - list then :lol:

It doesnt sound theres a simple and elegant solution, and I dont want to use too much time on hacking it together.

Thank you.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Wed Feb 18, 2009 12:13

Yeah, I'm not certain myself to be honest (and I wrote the thing!).

As I have been looking again at the rendering mechanism for Ogre, the way we're currently hooking in, while convenient and working in most cases, has the potential for causing issues such that you're seeing here.

For the 0.7.0 version renderers, I'm going to try and do things slightly differently which should allow more control over this (though it all depends on finding an appropriate solution, of course).

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 4 guests