[SOLVED] How to embed an Ogre viewport into a CEGUI::Window

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

Varela
Just popping in
Just popping in
Posts: 6
Joined: Wed Jan 06, 2010 14:20

[SOLVED] How to embed an Ogre viewport into a CEGUI::Window

Postby Varela » Fri Jan 29, 2010 10:44

Hello,

I would like to display an Ogre viewport inside a CEGUI dialog box. Is there any CEGUI window type that is oriented for this purpose?
I think this may be an usual thing to do (with Ogre or any other graphics engine) but I didn't find any topics on this. If there is can you point out to those?
I manage to achieve a not so good solution wich was to create a non visible zone in my CEGUI::FrameWindow by composing it with other CEGUI windows and then I inserted the ogre viewport in that zone. The moving and resizing of the ogre viewport is performed manually when the CEGUI::FrameWindow move and resize callbacks are called. The result was the following:

Image

The problem is that the ogre viewport is not really a child of the CEGUI::FrameWindow, and so if there is another GEGUI::Window already in the screen this viewport allways appears behind that window, while the children of the CEGUI::FrameWindow appear in front of it. This situation can be seen in the following capture where the title bar of the window which has the ogre viewport appears in front of the other window but the ogre viewport doesn't.

Image

So I think I really have to create an embedded ogre viewport in the CEGUI::Window.

Can you tell me how it's done.

Thank you.
Last edited by Varela on Fri Jan 29, 2010 14:42, edited 1 time in total.

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

Re: How to embed an Ogre viewport into a CEGUI::Window

Postby CrazyEddie » Fri Jan 29, 2010 13:03

Hi,

I think the only reliable way to do this would be to render the Ogre viewport to a texture and then use that texture as the basis of a CEGUI::Imageset in order that CEGUI can then render the content as part of the CEGUI::Window's visuals. It's highly doubtful that any other solution would give consistent or satisfactory results.

HTH

CE.

Varela
Just popping in
Just popping in
Posts: 6
Joined: Wed Jan 06, 2010 14:20

Re: How to embed an Ogre viewport into a CEGUI::Window

Postby Varela » Fri Jan 29, 2010 14:41

Yes, that's it. The approach is that one. and it all explained in Basic Tutorial 7 of Ogre Wiki page.
Anyone who as the same problem, just follow the tutorial.

Thank you for your help.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 13 guests