I am using freeglut and I want to be able to render GUI to two windows at the same time. Freeglut creates individual OpenGL context for each window. I would like to know, how to initialise CEGUI to do this.
Single window initialization:
Code: Select all
CEGUI::OpenGLRendererBase * renderer = &CEGUI::OpenGLRenderer::create();
CEGUI::System::create( *renderer );
/* ResourceProvider init */
.
.
.
/*-----*/
CEGUI::GUIContext * guiContext = new CEGUI::GUIContext( renderer->getDefaultRenderTarget() );
CEGUI::Window * myRoot = CEGUI::WindowManager::getSingleton().loadLayoutFromFile( filename );
guiContext->setRootWindow( myRoot );
And single window render:
Code: Select all
renderer->beginRendering();
guiContext->draw();
renderer->endRendering();
Now, if I want to draw two GUIs to two OpenGL contexts, I have to create two GUIContexts and give each its own RenderTarget. So I will have to create two Renderers but system can be initialised only once using only one Renderer. I don't know, how to solve this.
Thank you.