Page 1 of 1

[Solved]Framewindow is in "background" -Ogre 2.1|CEGUI v-0.8

Posted: Thu May 14, 2015 10:43
by jserve
Hi everyone,

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);

Re: Framewindow is in "background" - Ogre 2.1|CEGUI v-0.8

Posted: Thu May 14, 2015 11:07
by Ident
Go to your FrameWindow and set AutoRenderingSurface to false. You can do this in the looknfeel files if you want. Probably these are not implemented correctly in the OgreRenderer yet.

Re: Framewindow is in "background" - Ogre 2.1|CEGUI v-0.8

Posted: Thu May 14, 2015 17:25
by jserve
Boah Ident!
You saved my life again! Thanks :)

*cheers*