MyGUI in multiple renderwindows

jdxsolutions

28-09-2011 09:50:36

We are using some version of MyGUI 2 in a project where we render the scene into multiple windows - think like a 3D modeling tool. We cobbled together a system where each time a render-window was about to be rendered, we had to hide all of MyGUI and show the widgets relevant to that target... ugly :(

It seems like the RenderBox widget provides one way to avoid such kludges in version 3? But is it the only way or does MyGUI actually link widgets per-rendertarget at a deeper level? In other words if I just have multiple render targets, can I have a GUI for each without wrapping them in RenderBox widgets?

Altren

28-09-2011 13:26:32

RenderBox is not a widget - it is small wrapper, that helps to show meshes or information from Camera/Viewport. So nothing about rendering GUI inside.

And what about multiply render targets: MyGUI support rendering into texture, so easiest way will be to create a layers for each render target and use textures from this layers on different viewports.

jdxsolutions

28-09-2011 13:54:35

According to the docs, it is a widget: http://mygui.info/docs/class_my_g_u_i_1_1_canvas.html - but you're saying it doesn't support adding child widgets?

I didn't understand the second part of your reply. Let's say I have two Ogre::RenderWindow instances R1 & R2 and two layout files r1.layout & r2.layout. How do I manage it so r1.layout is shown on R1 and r2.layout on R2?

Altren

28-09-2011 18:55:33

Yeah, it was a widget earlier, but never for showing other widgets.

What about having two layers for different renderwindows - both layers are rendered into texture and not displayed at screen by default. To show GUI you should display this textures somehow.

jdxsolutions

28-09-2011 19:50:13

That sounds like you'd still have to register a frame listener or something - I thought in 3.0 MyGUI changed to support multi-window applications. Maybe the old problem was that MyGUI used to be singleton based, now you can create multiple MyGUI instances - does that sound likely?

Altren

28-09-2011 20:29:38

MyGUI still use singletons and there is only single instance of Gui and it's parts. And what I was saying about textures still done in single rendering context, so nothing changed there.

Could you explain your task a bit more, because I start thinking that you use GUI in some really odd way and there are much easier solutions for your task.

jdxsolutions

28-09-2011 21:11:14

I have two separate windows - e.g. 2 HWNDs each with its own Ogre::RenderWindow. This use-case is not so common in games, but is in tools. I don't understand your discussion of textures I'm afraid - I simply remember in 2.x MyGUI didn't have anything to support this (so we made ugly hack) and I was told this had changed in 3.x. Maybe it didn't.