I have a problem with FrameWindows. I use the actual v-0.8 branch. When I add a Button or Editbox widget directly it works fine. But when I add a Framewindow with content, either via code or layout files I just see it the 1st time after frameRenderingQueued(...) and after that sometimes just a flicker.
Could someone give me a point into the direction what I miss in my code?
1st Time: http://i.imgur.com/MMa61qn.png
2nd to .... time: http://i.imgur.com/xJ91clV.png
frameRenderingQueue:
Code: Select all
bool FrameListener1::frameRenderingQueued(const Ogre::FrameEvent& args)
{
float dt=args.timeSinceLastEvent;
CEGUI::System& gui_system = CEGUI::System::getSingleton();
gui_system.injectTimePulse(dt);
CEGUI::Renderer* gui_renderer(gui_system.getRenderer());
gui_renderer->beginRendering();
gui_system.getDefaultGUIContext().injectTimePulse(1e-2f);
gui_system.getDefaultGUIContext().draw();
gui_renderer->endRendering();
CEGUI::WindowManager::getSingleton().cleanDeadPool();
return true;
}
CEGUI Code:
Code: Select all
CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window *sheet = wmgr.createWindow("DefaultWindow", "Root");
CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(sheet);
CEGUI::Window *quit = wmgr.createWindow("TaharezLook/Button", "CEGUIDemo/QuitButton");
quit->setText("Quit");
quit->setSize(CEGUI::USize(CEGUI::UDim(0.15f, 0), CEGUI::UDim(0.05f, 0)));
quit->subscribeEvent(CEGUI::PushButton::EventMouseDoubleClick, CEGUI::Event::Subscriber(handleSampleEnterButtonClicked));
quit->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(handleSampleEnterButtonClicked));
sheet->addChild(quit);
CEGUI::Window *tb = wmgr.createWindow("TaharezLook/Editbox", "Editbox");
tb->setPosition(CEGUI::UVector2(CEGUI::UDim(0.5f, 0), CEGUI::UDim(0, 0)));
sheet->addChild(tb);
CEGUI::Window *wndFile=wmgr.loadLayoutFromFile("TextDemo.layout");
sheet->addChild(wndFile);