|
|
程序中只绘制了一次后屏幕就是ClearColor的颜色了,什么都看不到了,为什么?
g_pDevice->SetEngineMode(EMD_PERSPECTIVE);
g_pDevice->SetClearColor(1.0f,1.0f,1.0f);
g_pDevice->BeginRender(true,true,false);
g_pDevice->UseColorBuffer(true);
g_pDevice->UseTextures(false);
g_pDevice->SetBackfaceCulling(RS_CULL_NONE);
g_pDevice->SetShadeMode(RS_SHADE_SOLID,0,NULL);
g_pDevice->UseShaders(false);
model->Render();
g_pDevice->EndRender();
HRESULT BeginRender(bool bClearPixel,bool bClearDepth,bool bClearStencil)
{
if (bClearPixel || bClearDepth || bClearStencil)
{
if (bClearPixel)
{
dw|=D3DCLEAR_TARGET;
}
if (bClearDepth)
{
dw|=D3DCLEAR_ZBUFFER;
}
if (bClearStencil && m_bStencil)
{
dw|=D3DCLEAR_STENCIL;
}
if (FAILED(m_pD3dDevice->Clear(0,NULL,dw,m_ClearColor,1.0f,0)))
{
Log("Clear()---FAILED\n");
return Realm_FAIL;
}
}
} |
|