I've met some issue while upgrading CEGUI from 0.7.5 to 0.8.2.
First of all. I'm using Ogre in a SDL window using the code from the following URL to get easy cross-platform IM (input method) support.
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=67570
and enable CEGUI by the code using the folling code from http://loremar.frihost.org/2011/12/using-cegui-in-ogre3d/
Code: Select all
//Initialize CEGUI
mRenderer = &CEGUI::OgreRenderer::bootstrapSystem();
//Set default resource groups for each CEGUI's resource manager
CEGUI::Imageset::setDefaultResourceGroup("Imagesets");
CEGUI::Font::setDefaultResourceGroup("Fonts");
CEGUI::Scheme::setDefaultResourceGroup("Schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("LookNFeel");
CEGUI::WindowManager::setDefaultResourceGroup("Layouts");
//Set the skin/scheme
CEGUI::SchemeManager::getSingleton().create("TaharezLook.scheme");
//Set default mouse cursor
CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
this works perfectly with CEGUI 0.7.5, but whit some changes in 0.8.2 (function rename,etc......) it fails to work.
the first problem is that since my window in NOT created by Ogre but SDL. In CEGUI 0.8.2 CEGUI::OgreRenderer::bootstrapSystem() fails to return the correct value. and gave this info
Code: Select all
CEGUI::RendererException in function 'CEGUI::OgreRenderer::OgreRenderer()' (/home/marty/cegui-0.8.2/cegui/src/RendererModules/Ogre/Renderer.cpp:575) : Ogre was not initialised to automatically create a window, you should therefore be explicitly specifying a Ogre::RenderTarget in the OgreRenderer::create function.
terminate called after throwing an instance of 'CEGUI::RendererException'
what(): CEGUI::RendererException in function 'CEGUI::OgreRenderer::OgreRenderer()' (/home/marty/cegui-0.8.2/cegui/src/RendererModules/Ogre/Renderer.cpp:575) : Ogre was not initialised to automatically create a window, you should therefore be explicitly specifying a Ogre::RenderTarget in the OgreRenderer::create function.
so I tried to go around it.
Code: Select all
Ogre::RenderTarget* renderTarget = root->getRenderTarget("MainRenderWindow");
CEGUI::OgreRenderer& myRenderer = CEGUI::OgreRenderer::create(*renderTarget);
However this couses program crashes(memory IO error)
What should I do to enable CEGUI in this condition?
Thanks for any help.
UPDATE: Fix spelling error