Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi window rendering of different texts? #446

Open
ChenTianSky opened this issue May 15, 2024 · 1 comment
Open

Multi window rendering of different texts? #446

ChenTianSky opened this issue May 15, 2024 · 1 comment

Comments

@ChenTianSky
Copy link

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

@darksylinc
Copy link
Member

darksylinc commented May 15, 2024

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:

  1. Use two root windows and everything is derived from those windows. One root window for each Window.
  2. Use a CompositorWorkspaceListener::passPreExecute to identify your pass (use CompositorPassDef::mIdentifier for that) and...
  3. 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants