Esempio n. 1
0
	void RTTLayer::renderToTarget(IRenderTarget* _target, bool _update)
	{
		bool out_date = false;

		for (VectorILayerNode::iterator iter=mChildItems.begin(); iter!=mChildItems.end(); ++iter)
		{
			if ((*iter)->castType<LayerNode>()->isOutOfDate())
			{
				out_date = true;
				break;
			}
		}

		if (out_date || _update)
		{
			MyGUI::IRenderTarget* target = mTexture->getRenderTarget();
			if (target != nullptr)
			{
				target->begin();

				for (VectorILayerNode::iterator iter=mChildItems.begin(); iter!=mChildItems.end(); ++iter)
				{
					(*iter)->renderToTarget(target, _update);
				}

				target->end();
			}

		}
	}
void RTTLayer::renderToTarget(IRenderTarget* _target, bool _update)
{
    bool outOfDate = mOutOfDate || isOutOfDate();

    if (outOfDate || _update)
    {
        MyGUI::IRenderTarget* target = mTexture->getRenderTarget();
        if (target != nullptr)
        {
            target->begin();

            for (VectorILayerNode::iterator iter = mChildItems.begin(); iter != mChildItems.end(); ++iter)
                (*iter)->renderToTarget(target, _update);

            target->end();
        }
    }

    mOutOfDate = false;
}