My code now looks like this:
Code: Select all
// Create the gui context
CEGUI::System& ceguiSystem = CEGUI::System::getSingleton();
CEGUI::OgreRenderer* ogreRenderer = static_cast<CEGUI::OgreRenderer *>(ceguiSystem.getRenderer());
CEGUI::Sizef size(static_cast<float>(_width), static_cast<float>(_height));
_renderTextureTarget = ogreRenderer->createTextureTarget();
_renderTextureTarget->declareRenderSize(size);
_renderGuiContext = &ceguiSystem.createGUIContext(static_cast<CEGUI::RenderTarget&>(*_renderTextureTarget) );
_renderGuiContext->setRootWindow(_layoutWindow);
// Render
ogreRenderer->beginRendering();
_renderTextureTarget->clear();
_renderGuiContext->draw();
ogreRenderer->endRendering();
Alpha is still wrong (as in the screenshot), but the position of the window is now correctly at the bottom of the screen.
Afaik, the Ogre renderer uses shaders to render the GUI. Now, wherever these shaders are applied, they do not apply alpha correctly. For whatever reason.