Creating multiple Roots

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
xissburg
Halfling
Posts: 70
Joined: Sun Feb 21, 2010 4:58 pm
x 14

Creating multiple Roots

Post by xissburg » Wed Aug 07, 2019 4:22 pm

In an application where you have more than one viewport each rendering completely unrelated scenes I believe you'd have to create a new Root, a new SceneManager, etc. Due to the internal usage of singletons in Ogre that's not possible. What's the correct way of doing this? I have searched but could not find any conclusive discussion in the forums.

Thanks
0 x

xissburg
Halfling
Posts: 70
Joined: Sun Feb 21, 2010 4:58 pm
x 14

Re: Creating multiple Roots

Post by xissburg » Wed Aug 07, 2019 5:12 pm

So I guess I am supposed to create multiple SceneManagers and associate them with their respective RenderWindow via the CompositorManager2 from the same Root, using addWorkspace. Though Ogre::Root::renderOneFrame will update and render all workspaces/viewports. What if I want to update/render only one of them?
0 x

xrgo
OGRE Expert User
OGRE Expert User
Posts: 1038
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 68

Re: Creating multiple Roots

Post by xrgo » Wed Aug 07, 2019 5:56 pm

iirc that's the way to do it. and you can disable rendering on one window just by calling workspace->setEnabled( false )
0 x

xissburg
Halfling
Posts: 70
Joined: Sun Feb 21, 2010 4:58 pm
x 14

Re: Creating multiple Roots

Post by xissburg » Thu Aug 08, 2019 3:23 pm

xrgo wrote:
Wed Aug 07, 2019 5:56 pm
iirc that's the way to do it. and you can disable rendering on one window just by calling workspace->setEnabled( false )
Yeah I am gonna give that a try. Thanks.
0 x

Post Reply