Preview Window

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

Preview Window

Post by Mr. Turner » Sun Mar 13, 2005 6:29 pm

I'm looking for a method to make a preview window. I have a "add entity" dialog that uses name and meshfile to create an entity. Now I want to display a preview of the meshfile in a small window next to the meshlist without changing the scene in the mainwindow.

I searched the forums and I found that I should use a swapchains method and a RenderTargetListener.

But I can't figure out how it works. Are there any usefull examples? Is this method cross platform?

Thanks

Mr. Turner
0 x

User avatar
Wooden
Halfling
Posts: 58
Joined: Thu Feb 10, 2005 10:35 pm
Location: Arcachon, France
Contact:

Post by Wooden » Sun Mar 13, 2005 7:15 pm

If it's a CEGUI window, i know there's a rendertotexture in CEGUI look at the gui demo
0 x

Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

Post by Mr. Turner » Sun Mar 13, 2005 8:16 pm

I'm sorry, it's a wxWidget window. But I'll have a look at it anyway.
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Post by jacmoe » Sun Mar 13, 2005 9:05 pm

If it's just a preview window - it would be better to just spawn a new Ogre, since it does not need to be synchronized with the "main" Ogre. ? :? :)
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

Post by Mr. Turner » Sun Mar 13, 2005 9:19 pm

Is that possible? I thought you could only run 1 root, 1 scenemanager at the same time? They both have to be visible at the same time.
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Post by jacmoe » Sun Mar 13, 2005 9:26 pm

Well, of course this is a singleton ... one way to avoid it, is to spawn another program. :)
A command-line mesh-viewer ? :wink:
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

Post by Mr. Turner » Sun Mar 13, 2005 9:27 pm

Demo_Gui works differently. It hides the overlay, renders, unhides it. It gave me an idea though.

What do you guys think about this:

Hide the whole scene
Show the preview Node
Create texture of scene and send it to the previewwindow
Show the whole scene
continue rendering

Is this doable (performance related)?
Is this what is supposed to be done with RenderTargetListeners?

Mr. Turner
0 x

DarkSun
Kobold
Posts: 35
Joined: Wed Mar 10, 2004 12:10 pm
Location: Bielefeld, Germany

Post by DarkSun » Sun Mar 13, 2005 10:58 pm

Yes, it should work.
Chronos does this the same way.
0 x

User avatar
Antiarc
Greenskin
Posts: 120
Joined: Thu Jan 23, 2003 8:40 am
Contact:

Post by Antiarc » Mon Mar 14, 2005 6:29 pm

Yes, this is how it's done in Chronos, as DarkSun said. I modified the base scene manager to give me two methods, which override and restore the root scene node, so I can essentially switch the node that acts as the root scene node. This lets me essentially switch between multiple scenes per frame.
0 x

Post Reply