cegui渲染流程图
2016-08-10 10:44:21 0 举报subscribeEvent(CEGUI::RenderingSurface::EventRenderQueueStarted,
void Direct3D9GeometryBuffer::draw() const
{
RECT saved_clip;
d_device->GetScissorRect(&saved_clip);
// setup clip region
RECT clip;
clip.left = static_cast<LONG>(d_clipRect.left());
clip.top = static_cast<LONG>(d_clipRect.top());
clip.right = static_cast<LONG>(d_clipRect.right());
clip.bottom = static_cast<LONG>(d_clipRect.bottom());
// apply the transformations we need to use.
if (!d_matrixValid)
updateMatrix();
d_device->SetTransform(D3DTS_WORLD, &d_matrix);
d_owner.setupRenderingBlendMode(d_blendMode);
const int pass_count = d_effect ? d_effect->getPassCount() : 1;
for (int pass = 0; pass < pass_count; ++pass)
{
// set up RenderEffect
if (d_effect)
d_effect->performPreRenderFunctions(pass);
// draw the batches
size_t pos = 0;
BatchList::const_iterator i = d_batches.begin();
for ( ; i != d_batches.end(); ++i)
{
if (i->clip)
d_device->SetScissorRect(&clip);
d_device->SetTexture(0, i->texture);
d_device->DrawPrimitiveUP(D3DPT_TRIANGLELIST, i->vertexCount / 3,
&d_vertices[pos], sizeof(D3DVertex));
pos += i->vertexCount;
if (i->clip)
d_device->SetScissorRect(&saved_clip);
}
}
// clean up RenderEffect
if (d_effect)
d_effect->performPostRenderFunctions();
}
{
d_geometry->setRenderEffect(effect);
}子主题
d_effect->performPreRenderFunctions(pass);还是
d_effect->performPostRenderFunctions();
他们本质上都是绘制到上一层renderwindowing上,如果你用固定管线绘制,不用设置矩阵,自然就可以默认绘制到当前纹理上,如果使用HLSL,千万记得获取设置矩阵