本文整理汇总了C++中CompositorChain类的典型用法代码示例。如果您正苦于以下问题:C++ CompositorChain类的具体用法?C++ CompositorChain怎么用?C++ CompositorChain使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CompositorChain类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _reconstructAllCompositorResources
//---------------------------------------------------------------------
void CompositorManager::_reconstructAllCompositorResources()
{
// In order to deal with shared resources, we have to disable *all* compositors
// first, that way shared resources will get freed
typedef vector<CompositorInstance*>::type InstVec;
InstVec instancesToReenable;
for (Chains::iterator i = mChains.begin(); i != mChains.end(); ++i)
{
CompositorChain* chain = i->second;
CompositorChain::InstanceIterator instIt = chain->getCompositors();
while (instIt.hasMoreElements())
{
CompositorInstance* inst = instIt.getNext();
if (inst->getEnabled())
{
inst->setEnabled(false);
instancesToReenable.push_back(inst);
}
}
}
//UVs are lost, and will never be reconstructed unless we do them again, now
if( mRectangle )
mRectangle->setDefaultUVs();
for (InstVec::iterator i = instancesToReenable.begin(); i != instancesToReenable.end(); ++i)
{
CompositorInstance* inst = *i;
inst->setEnabled(true);
}
}
示例2: delete
DeferredShadingSystem::~DeferredShadingSystem()
{
// Delete mini lights
for(std::set<MLight*>::iterator i=mLights.begin(); i!=mLights.end(); ++i)
{
delete (*i);
}
// Delete the ambient light
delete mAmbientLight;
if (mCurrentMode==DSM_SHOWLIT && mInstance[mCurrentMode]->getEnabled())
{
RenderTarget* renderTarget = mInstance[mCurrentMode]->getRenderTarget("mrt_output");
assert(renderTarget);
LogManager::getSingleton().logMessage("Removing Listener from:");
LogManager::getSingleton().logMessage(renderTarget->getName());
renderTarget->removeListener(this);
}
CompositorChain *chain = CompositorManager::getSingleton().getCompositorChain(mViewport);
for(int i=0; i<DSM_COUNT; ++i)
chain->_removeInstance(mInstance[i]);
delete mLightMaterialGenerator;
}
示例3:
DeferredShadingSystem::~DeferredShadingSystem()
{
CompositorChain *chain = CompositorManager::getSingleton().getCompositorChain(mViewport);
for(int i=0; i<DSM_COUNT; ++i)
chain->_removeInstance(mInstance[i]);
CompositorManager::getSingleton().removeCompositorChain(mViewport);
}
示例4: getByName
//-----------------------------------------------------------------------
CompositorInstance *CompositorManager::addCompositor(Viewport *vp, const String &compositor, int addPosition)
{
CompositorPtr comp = getByName(compositor);
if(comp.isNull())
return 0;
CompositorChain *chain = getCompositorChain(vp);
return chain->addCompositor(comp, addPosition==-1 ? CompositorChain::LAST : (size_t)addPosition);
}
示例5: getCompositorChain
//-----------------------------------------------------------------------
void CompositorManager::setCompositorEnabled(Viewport *vp, const String &compositor, bool value)
{
CompositorChain *chain = getCompositorChain(vp);
for(size_t pos=0; pos < chain->getNumCompositors(); ++pos)
{
CompositorInstance *instance = chain->getCompositor(pos);
if(instance->getCompositor()->getName() == compositor)
{
chain->setCompositorEnabled(pos, value);
break;
}
}
}
示例6:
DeferredShadingSystem::~DeferredShadingSystem()
{
CompositorChain *chain = CompositorManager::getSingleton().getCompositorChain(mViewport);
for(int i=0; i<DSM_COUNT; ++i)
chain->_removeInstance(mInstance[i]);
CompositorManager::getSingleton().removeCompositorChain(mViewport);
Ogre::CompositorManager& compMgr = Ogre::CompositorManager::getSingleton();
CompositorLogicMap::const_iterator itor = mCompositorLogics.begin();
CompositorLogicMap::const_iterator end = mCompositorLogics.end();
while( itor != end )
{
compMgr.unregisterCompositorLogic( itor->first );
delete itor->second;
++itor;
}
mCompositorLogics.clear();
}