about NotifyDisplaysizeChanged in multiple window rendering

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

epsxk82
Just popping in
Just popping in
Posts: 3
Joined: Mon Jan 19, 2015 05:01

about NotifyDisplaysizeChanged in multiple window rendering

Postby epsxk82 » Mon Jan 19, 2015 05:36

Hi,
I'm integrating CEGUI into our own 3D rendering engine.
a thing i'm getting stuck in now is how to deal with NotifyDisplaysizeChanged in multiple window rendering on our rendering engine(we call this multiple window rendering multiple channel rendering now).

Each channel owns a rendering context created with wglCreateContextAttribs.
On Each rendering frame, Each channel is bound using wglMakeCurrent.
I created a GUIContext per channel.
Here is a code snippet for rendering frame on multiple channel(window) rendering.
-----------------------------------------------------------------------------
RenderingEngine->setChannel(Channel1);
RenderingEngine->render(); -> GUIContext1->draw() is done here


RenderingEngine->setChannel(Channel2);
RenderingEngine->render(); -> GUIContext2->draw() is done here

RenderingEngine->setChannel(Channel3);
RenderingEngine->render(); -> GUIContext3->draw() is done here
-----------------------------------------------------------------------------

I think I need to notify window size to CEGUI per channel(maybe per GUIContext in my case) because each channel can highly have different window size.
But i can't find the way.
I tried to call CEGUI::System::GetSingleton()->notifyDislpySizeChanged on every RenderingEngine->render() call.
But I found it would take much overhead.

User avatar
Ident
CEGUI Team
Posts: 1836
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: about NotifyDisplaysizeChanged in multiple window render

Postby Ident » Mon Jan 19, 2015 14:46

I take it that your rendering engine is based on OpenGL.

You say you use multiple windows. What kind of "windows" are we talking about? Do they share an OpenGL context? Please tell me more about your setup.
CrazyEddie: "I don't like GUIs"

epsxk82
Just popping in
Just popping in
Posts: 3
Joined: Mon Jan 19, 2015 05:01

Re: about NotifyDisplaysizeChanged in multiple window render

Postby epsxk82 » Mon Jan 26, 2015 02:49

Here is the illustrative example.
Image

About the windows, those can be any kind of windows.
If in c++, those can be created with CreateWinodw from WINAPI.
If in c#, those can be the user control such as Panel, Form from WinForms or WPF Control such as Frame, Canvas From WPF.
Our rendering engine can render anywhere given the window handle.... even on the Desktop.

In Multiple window rendering. we share an OpenGL Context.
Last edited by epsxk82 on Fri Feb 13, 2015 02:21, edited 6 times in total.

User avatar
Ident
CEGUI Team
Posts: 1836
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: about NotifyDisplaysizeChanged in multiple window render

Postby Ident » Mon Jan 26, 2015 10:52

I cannot see your image. Please try uploading it as attachment.

Ok so you meant "application windows" or "host windows". And you share an OpenGL context. The latter is definitely a good idea because otherwise CEGUI wouldn't work at all since textures etc couldnt be shared. GUIContexts can have different sizes. Without having tried it myself, I am surprised this does not work right away. This is likely a bug. It would be nice to be able to try this out but I have no simple way to reconstruct this scenario atm: I would first have to setup a glfw3 multi-window application with CEGUI. If you could provide us with a simple reconstruction, we can look into this sooner. Otherwise, for now I currently have no suggestions to resolve the issue, it is most likely a bug that might require quite some changes to CEGUI. I will look into it after my exam crunch time is over (~2 weeks), sorry I can't do it quicker, maybe another developer or user will have time to do it now.

Alternatively, if you want to look into it yourself (reading the CEGUI code and understanding and modifying it) you can ask us here or in the chat and we can maybe resolve the issue together, you can make a Pull Request with the fix then.
CrazyEddie: "I don't like GUIs"

epsxk82
Just popping in
Just popping in
Posts: 3
Joined: Mon Jan 19, 2015 05:01

Re: about NotifyDisplaysizeChanged in multiple window render

Postby epsxk82 » Tue Jan 27, 2015 02:36

I corrected the image URL.
The GUI Library used in the above example is Winforms basically given in Visual Studio.
In the example image above, the dialog is a form with 3 of child panels.
Our rendering engine is rendering in 3 channel way each rendering channel rendering on a separate panel.

As you can see the above image, the rendering works well.

My problem is this.

I looked into the System::notifyDisplaySizeChanged().
From this, i think the font size, and the image size is scaled by the factors given from this method.
And other factors such as event handling, input handling to widgets, also seem to be affected from this method call.

I need to give different font size, image size to each window channel separately because each window can have a different size.
So i think i need to notify each GUIContext of a display size separately(In my case, because each rendering channel is bound to a GUIContext).

I think i can handle this without changing the source code.
I think, Given i know completely what does System::notifyDisplaySizeChanged() do, I can make System::notifyDisplaySizeChanged()'s job done by separating out that job into the divided jobs done per a GUIContext instead of calling System::notifyDisplaySizeChanged().
If i'm right, could you tell me what i should do per a GUIContext instead of calling System::notifyDisplaySizeChanged().

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: about NotifyDisplaysizeChanged in multiple window render

Postby lucebac » Tue Jan 27, 2015 08:57

The image is still broken...

But: why don't you look into the CEGUI source code? Everything is there and you can see what notifyDisplaySize does:
https://bitbucket.org/cegui/cegui/src/d ... 0-8#cl-582

User avatar
Ident
CEGUI Team
Posts: 1836
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: about NotifyDisplaysizeChanged in multiple window render

Postby Ident » Thu Jan 29, 2015 21:00

I think he already looked into it.

I am pretty sure what he wants is not possible without a modification to the function or even the overall system of rendering.
CrazyEddie: "I don't like GUIs"


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 2 guests