Just want to say CEGUI is great and is a fun learning experience. I have a query with regard to a technique for loading CEGUI on two different scene managers in Ogre.
Here is my story:
I have a primary scene manger and I would like to switch to the secondary scene manager by clicking for e.g. an 'OK' button in the primary scene manager (i have been able to do that). But here is the problem once I switch to the secondary scene manager I would like render another separate GUI layout (with buttons, etc).
I understand that CEGUI will only render itself on one scene at a time. So I here's what I have:
I have a createScene() function which is overidden from the ExampleApplication.h and that basically initialises CEGUI just like in the tutorial.
Code: Select all
void createScene(void)
{
mPrimary->setSkyDome(true, "Examples/CloudySky");
mSecondary->setSkyBox(true, "Examples/SpaceSkyBox");
//Initialisation of CEGui for Window_1
mRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mPrimary);
mSystem = new CEGUI::System(mRenderer);
CEGUI::SchemeManager::getSingleton().loadScheme("TaharezLookSkin.scheme"); //Initialise skin (looknfeel)
CEGUI::SchemeManager::getSingleton().loadScheme("WindowsLook.scheme");
mSystem->setDefaultMouseCursor("TaharezLook", "MouseArrow"); //Initialise default mouse cursor
mSystem->setDefaultFont("BlueHighway-12"); // Set Up Font
//Creating a default CEGUI window to insert widgets
CEGUI::WindowManager *win = CEGUI::WindowManager::getSingletonPtr();
//CEGUI::Window *sheet = win->createWindow("DefaultGUISheet", "CEGUIDemo/Sheet");
CEGUI::Window *sheet = win->loadWindowLayout("Configuration_Window.xml");
mSystem->setGUISheet(sheet); //Set current GUI sheet for system to be this sheet
}
Also I am trying for arguments sake to load the same GUI in different scene managers. (Hence only one GUI layout). My event handling is done in the constructor of a class which inherits from the ExampleFrameListener.h class and is implemented as follows.
Code: Select all
CEGUI::Window *start = wmgr->getWindow("Root//5");
start->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&TutorialListener::OK_Clicked, this));
I was hoping to switch scene managers in the 'OK_Clicked' function but it does not work and I also tried mRenderer->setTargetSceneManager(...).
Any help will be appreciated as this might be something easy to solve but my brain isnt clicking.
Thanks
