I've been doing some work with the Oculus Rift, using the already existing Ogre Oculus library. In order to use the menus already present in our software, I've started rendering the output from CEGUI onto a texture, and placed that texture on a surface in game (basically a plane that hovers in front of the players body, at all times).
The issue I'm having is that since this texture is created manually, it doesn't properly update. If I have an actual menu open, those work fine. But background CEGUI stuff doesn't erase my old curser, so when I move it, it leaves a trail of cursers behind it. But most importantly, when I close a menu, then it stays on screen, in its last state. It's technically closed, but its graphics are still painted onto the canvas.
Here's what I'm doing:
Code: Select all
Ogre::RenderWindow* renderWindow( PresMgr::getInstance()->getRenderWindow() );
if (VRMODE) // // I shouldn't need a VRMODE switch here. If done correctly, placing the CEGUI canvas in front of the player should work. However, as there are still some issues with this, I'm using the switch for now. FIXME
{ // Sets up CEGUI, to be displayed on the Oculus Rift.
auto& texMgr = Ogre::TextureManager::getSingleton();
mGuiGlass = texMgr.createManual( "CEGUITexture",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Ogre::TEX_TYPE_2D,
renderWindow->getWidth(),
renderWindow->getHeight(),
0,
Ogre::PF_R8G8B8,
Ogre::TU_RENDERTARGET );
mpRenderer = &( CEGUI::OgreRenderer::bootstrapSystem( * ( mGuiGlass->getBuffer()->getRenderTarget() ) ) );
}
-cullam