Multi window rendering of different texts?
Opened this issue · 1 comments
I use Ogre:: v1:: Overlay as a container to add Ogre:: v1:: TextAreaOverlayElement to different windows, but the text from multiple windows will be stacked together and rendered on each window. How can I achieve rendering different text on different windows? For example, rendering hello in window A and world in window B
Hi!
You have multiple ways (assuming two windows, but it extends to N windows):
If interactions only happen in one window and the other windows just show data:
- Use two root windows and everything is derived from those windows. One root window for each Window.
- Use a
CompositorWorkspaceListener::passPreExecute
to identify your pass (use CompositorPassDef::mIdentifier for that) and... - Set all root windows to hidden (via setHidden( true )) except the one belonging to the root window.
If each window needs full functionality:
You'll need the very recent OffScreenCanvas
(needs OgreNext >= 3.0). See OffScreenCanvas2D and OffScreenCanvas3D samples.
Rather than using OffScreenCanvas::createTexture
you can create the workspace externally (one for each Window) and use OffScreenCanvas::setWorkspace
directly.
You'll get multiple secondary ColibriManagers (one OffScreenCanvas and ColibriManager per window) that are independent (you can't migrate widgets from one window to another though).