Page 1 of 1

Multiple Windows with CEGUI?

Posted: Tue May 22, 2012 00:52
by EnigmaticProgrammer
I'm using one base opengl render context created with a dummy window. I then have multiple windows and when I render to one of them I do this: wglMakeCurrent( Window->hDC, Base->hRC );

Is there a way to get CEGUI to work with this configuration?

Also:

Code: Select all

CEGUI::OpenGLRenderer& myRenderer = CEGUI::OpenGLRenderer::bootstrapSystem();


When I try to run this code after I create the base render context I get an exception: CEGUI::GenericException at memory location 0x0228da6c.

Re: Multiple Windows with CEGUI?

Posted: Tue May 22, 2012 05:29
by Kulik
:(

When asking for help: Always post your CEGUI.log and the text of any error or exception messages. Thank you!
By failing to comply, you grant us permission to mock you on IRC



btw: Telling us the exact memory location where the exception was allocated at isn't of much use :wink:

Multi window rendering might be tricky, you will likely have to do tricks like exchange the GUISheet and render and input inject one at a time. It would be a bit easier if I knew the version of course. This is much easier with the upcoming CEGUI 1.0 (not released yet!) with multiple GUI contexts (though I am not sure whether it's fully supported out of the box, it should be easy to add if it's not).

Re: Multiple Windows with CEGUI?

Posted: Tue May 22, 2012 06:50
by CrazyEddie
To add to this a little...

Given the exception you're seeing, you almost certainly will not have a CEGUI.log to post. In this scenario, it would be the exception message and some version information that we would like you to post. Of course, being a total newbie, you may not be aware that the CEGUI exceptions have messages that you can output, or that the exception classes are derived from std::exception and that you can use familiar mechanisms to get the message :) I think these are areas that we need to work on too - yes these things are relatively easy to research, though for many newcomers it must also be accepted that it can be easy to become overwhelmed. Getting this balance right is sometimes difficult.

With regards to a multiple context set up, I would like to add to what Kulik said, and say that it depends on what you are wanting to achieve. Meaning is the goal to have CEGUI content in multiple contexts, or is the goal to have multiple GL contexts, but only render CEGUI content to one of them. Both are possible, but the whats and the hows will vary according to the intended usage (and the version you are using).

CE.

Re: Multiple Windows with CEGUI?

Posted: Tue May 22, 2012 08:34
by EnigmaticProgrammer
I am using version 0.7.6 of CEGUI and OpenGL 3.1. I am actually using a trick with only one render context or I guess two since I had to create a 1.1 OpenGL context to get a 3.1 context. Anyway, I then set the pixel format for each window I create to that of the opengl context and using MakeCurrent the way I posted above I can render to multiple windows with the same context.

Re: Multiple Windows with CEGUI?

Posted: Tue May 22, 2012 09:02
by CrazyEddie
For OpenGL 3.x, much will depend on the context you're creating. If it's a compatible context, then all should be fine. If it's core profile, you will require the GL3 CEGUI renderer that exists in the current development code (mercurial default branch).

I think for the scenario you describe, CEGUI should work - just make sure the context you intend rendering to (i,e the GL 3 one) is active when you call the bootstrapSystem function. It may work anyway, especially if resources are shared between contexts.

If you decide to go for the mercurial devel code, then be aware that the tutorials and what not are not currently updated to be compatible with that. In this case, you might consider joining #cegui on irc.freenode.net, since it's sometimes easier to get help that way (we are there during the day for europe).

CE.

Re: Multiple Windows with CEGUI?

Posted: Tue May 22, 2012 11:36
by EnigmaticProgrammer
CrazyEddie wrote:For OpenGL 3.x, much will depend on the context you're creating. If it's a compatible context, then all should be fine. If it's core profile, you will require the GL3 CEGUI renderer that exists in the current development code (mercurial default branch).

I think for the scenario you describe, CEGUI should work - just make sure the context you intend rendering to (i,e the GL 3 one) is active when you call the bootstrapSystem function. It may work anyway, especially if resources are shared between contexts.

If you decide to go for the mercurial devel code, then be aware that the tutorials and what not are not currently updated to be compatible with that. In this case, you might consider joining #cegui on irc.freenode.net, since it's sometimes easier to get help that way (we are there during the day for europe).

CE.


Unfortunately OpenGL 3.1 does not appear to have a compatibility context but OpenGL 3.2 does. I'm using CG Toolkit which does not support anything over OpenGL 3.1. I thought CEGUI sounded like it would be a quick way to add a GUI to my game engine but it's sounding more and more like I should just develop my own. CrazyEddie you seem like a pretty helpful fellow and from what I can tell your API appears to be pretty awesome. As of right now though I'm afraid it is simply too much work to integrate it in to my own project but I may come back to it at some point in the future. Thank you for the assistance you have provided and keep doing what you are doing!