本文整理汇总了C++中ogre::Overlay::get2DElementsIterator方法的典型用法代码示例。如果您正苦于以下问题:C++ Overlay::get2DElementsIterator方法的具体用法?C++ Overlay::get2DElementsIterator怎么用?C++ Overlay::get2DElementsIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Overlay
的用法示例。
在下文中一共展示了Overlay::get2DElementsIterator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateOnEveryRenderable
void ResourceGroupReloader::updateOnEveryRenderable()
{
//1/ get all the available object type (entity, light, user defined types ...)
std::vector<std::string> allAvailableTypes;
Ogre::Root::MovableObjectFactoryIterator iterFactory = Ogre::Root::getSingleton().getMovableObjectFactoryIterator();
for(;iterFactory.hasMoreElements();)
{
Ogre::MovableObjectFactory* factory = iterFactory.getNext();
allAvailableTypes.push_back(factory->getType());
}
UpdateMaterialRenderableVisitor lRenderableVisitor;
//2/ for each scene manager, lets visit renderables!
// unfortunately that does not cover all renderables type... (overlays...)
Ogre::SceneManagerEnumerator::SceneManagerIterator iterSceneManager = Ogre::Root::getSingleton().getSceneManagerIterator();
for(;iterSceneManager.hasMoreElements();)
{
Ogre::SceneManager * scMgr = iterSceneManager.getNext();
std::vector<std::string>::iterator iterMovableType = allAvailableTypes.begin();
std::vector<std::string>::iterator iterMovableTypeEnd = allAvailableTypes.end();
for(;iterMovableType!=iterMovableTypeEnd;iterMovableType++)
{
Ogre::SceneManager::MovableObjectIterator iterMovable = scMgr->getMovableObjectIterator(*iterMovableType);
for(;iterMovable.hasMoreElements();)
{
Ogre::MovableObject * movable = iterMovable.getNext();
movable->visitRenderables(&lRenderableVisitor,false);
}
}
}
// 3 / visit overlays!
{
Ogre::OverlayManager::OverlayMapIterator iterOverlay = Ogre::OverlayManager::getSingleton().getOverlayIterator();
for(;iterOverlay.hasMoreElements();)
{
Ogre::Overlay* lOverlay = iterOverlay.getNext();
// get the first level of OverlayContainer in the Overlay
Ogre::Overlay::Overlay2DElementsIterator iterOverlayElem = lOverlay->get2DElementsIterator();
for(;iterOverlayElem.hasMoreElements();)
{
Ogre::OverlayContainer * lOverlayCont = iterOverlayElem.getNext();
visitRecursivelyRenderablesFrom(lOverlayCont,lRenderableVisitor, false);
}
}
}
}
示例2: preViewportUpdate
void OverlayMask::preViewportUpdate(const Ogre::RenderTargetViewportEvent &event)
{
if(event.source == mViewport)
{
Ogre::OverlayManager &overlayMgr = Ogre::OverlayManager::getSingleton();
for(Ogre::OverlayManager::OverlayMapIterator iter = overlayMgr.getOverlayIterator();
iter.hasMoreElements();)
{
Ogre::Overlay* item = iter.getNext();
for(Ogre::Overlay::Overlay2DElementsIterator it = item->get2DElementsIterator();
it.hasMoreElements();)
{
Ogre::OverlayContainer* container = it.getNext();
if(container) container->hide();
}
}
std::map<CSMWorld::CellCoordinates, TextOverlay *>::iterator it = mTextOverlays.begin();
for(; it != mTextOverlays.end(); ++it)
{
it->second->show(true);
}
}
}