Ok, i can understand that but this way was the best way i could think of setting it up:
Code: Select all
void GameState::create3DUI()
{
Ogre::Entity* screen = m_pSceneMgr->getEntity("Monitor");
// create a texture render target.
Ogre::TexturePtr UI = Ogre::TextureManager::getSingletonPtr()->createManual("user interface",Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,Ogre::TEX_TYPE_2D,512,512,32,1,PF_FLOAT16_RGBA,TU_RENDERTARGET);
// Declare a renderable texture and get the pointer to the render target.
Ogre::RenderTexture* rUI = UI->getBuffer()->getRenderTarget();
Ogre::Camera* uiCam = m_pSceneMgr->createCamera("UI");
Ogre::Viewport* uiView = rUI->addViewport(uiCam);
uiView->setClearEveryFrame(true);
uiView->setOverlaysEnabled(false);
uiView->update();
// create a material to add to the entity.
Ogre::MaterialPtr uiMaterial = Ogre::MaterialManager::getSingletonPtr()->create("uiMaterial",Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
// get the default tech/pass.
Ogre::Technique* uiTech = uiMaterial->getTechnique(0);
Ogre::Pass* uiPass = uiTech->getPass(0);
uiPass->createTextureUnitState(UI->getName());
CEGUI::OgreRenderer* pUIRenderer = new CEGUI::OgreRenderer(CEGUI::OgreRenderer::bootstrapSystem(*uiView->getTarget()));
CEGUI::Imageset::setDefaultResourceGroup("Imagesets");
CEGUI::Font::setDefaultResourceGroup("Fonts");
CEGUI::Scheme::setDefaultResourceGroup("Schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("LookNFeel");
CEGUI::WindowManager::setDefaultResourceGroup("Layouts");
CEGUI::SchemeManager::getSingletonPtr()->create("TaharezLook.Scheme");
CEGUI::System::getSingletonPtr()->setDefaultMouseCursor("TaharezLook","MouseArrow");
// create a default window.
CEGUI::Window* DefaultWin = CEGUI::WindowManager::getSingletonPtr()->createWindow("Default","UI Window/");
// create a simple frame window.
CEGUI::FrameWindow* simFrame = reinterpret_cast<CEGUI::FrameWindow*>(CEGUI::WindowManager::getSingletonPtr()->createWindow("TaharezLook/FrameWindow","Frame"));
simFrame->setSize(CEGUI::UVector2
(CEGUI::UDim(0.15,0),CEGUI::UDim(0.20,0)));
DefaultWin->addChildWindow(simFrame);
OgreFramework::getSingletonPtr()->m_pSystem->setGUISheet(DefaultWin);
screen->setMaterial(uiMaterial);
}
so, yea, hopefully someone knows how to get this to work.