示例#1
0
void IRenderQueue::PrintRenderQueue(const RenderableNodeList& nodes)
{
	HeapString testStr;
	size_t count = nodes.Count();
	FOR_EACH_SIZE(i, count)
	{
		IRenderable* node = (IRenderable*)nodes[i];
		testStr.AppendFormat("{}:{}:{}\n", node->Id(), node->Material()->Name().c_str(), node->Name().c_str());
	}
void BaseSingleBatchRenderQueue::Update(RenderableChangedFlags changedFlag)
{
	RETURN_IF_EQUAL(changedFlag, RenderableChangedFlags::None);

	if (changedFlag.IsBatchChanged()||changedFlag.IsRenderQueueChanged())
	{
		mBatch->Prepare();
		if (!mNodes.IsEmpty())
		{
			IRenderable* node = mNodes.First();
			mBatch->SetEffect(node->Material()->Effect());
			mBatch->SetMaterial(node->Material());
			mBatch->SetDrawMode(node->Material()->DrawMode());
			mBatch->SetStateTreeNode(node->RenderStateTreeNode());
		}

		FOR_EACH_COLLECTION(i, mNodes)
		{
			mBatch->AddNode(*i);
		}