//---------------------------------------------------------------------
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);
    }
}
Example #2
0
//-----------------------------------------------------------------------
void CompositorManager::setCompositorEnabled(Viewport *vp, const String &compositor, bool value)
{
	CompositorChain *chain = getCompositorChain(vp);
	CompositorChain::InstanceIterator it = chain->getCompositors();
	for(size_t pos=0; pos < chain->getNumCompositors(); ++pos)
	{
		CompositorInstance *instance = chain->getCompositor(pos);
		if(instance->getCompositor()->getName() == compositor)
		{
			chain->setCompositorEnabled(pos, value);
			break;
		}
	}
}
Example #3
0
//---------------------------------------------------------------------
void CompositorManager::_reconstructAllCompositorResources()
{
	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);
				inst->setEnabled(true);
			}
		}
	}
}