您的位置:首页 > 产品设计 > UI/UE

Use ogre rtt in cegui 0.8

2015-01-01 08:49 399 查看

Ogre rtt in cegui  0.8

It's easy to display ogre rtt in cegui, but something should be taking care of.

1. set up ogre texture

mpOgreTexture = &static_cast<CEGUI::OgreTexture&>(getOgreRenderer()->createTexture("OgreTexture"));

mpOgreTexture->setOgreTexture(ogreRtt);   

2. set up cegui image, don't forget the image area.

mpImage = static_cast<CEGUI::BasicImage*>(&CEGUI::ImageManager::getSingleton().create("BasicImage",imageName));

mpImage ->setTexture(mpOgreTexture);

CEGUI::Rectf imageArea(0.0f, 0.0f, yourRttWidth, yourRttHeight);

mpImage->setArea(imageArea);

mpImage->setAutoScaled(CEGUI::ASM_Disabled);

3. set image property of your cegui window at last.

mpimgTex->setProperty("Image", imageName);

Be careful

      If your cegui window resides in FrameWindow, you must turn AutoRenderingSurface to false, 
      otherwise cegui will use imagery cash to display rtt.
      If you change rtt to another one at realtime, you need to call,
            mpimgTex->invalidate();
      this tell cegui to change texture, otherwise it will sill use display previous rtt.



       
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ogre cegui rtt