|
|
渲染函数
{
g_pd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, 1.0f, 0);
g_pd3dDevice->BeginScene();
.........
//设置雾化
g_pd3dDevice -> SetRenderState( D3DRS_FOGENABLE, TRUE);
g_pd3dDevice -> SetRenderState( D3DRS_FOGCOLOR, 0x00ffffFF);
g_pd3dDevice -> SetRenderState( D3DRS_RANGEFOGENABLE, true);
float start = 150;
float end = 2000;
g_pd3dDevice ->SetRenderState(D3DRS_FOGSTART, *(DWORD*)&start);
g_pd3dDevice ->SetRenderState(D3DRS_FOGEND, *(DWORD*)&end);
g_pd3dDevice ->SetRenderState(D3DRS_FOGTABLEMODE,D3DFOG_LINEAR);
//FPS
TheFPS.DrawFont();
g_pd3dDevice->EndScene();
g_pd3dDevice-> resent(0, 0, 0, 0);
}
DrawFont()定义如下
void FPSCounter: rawFont()
{
RECT sRect;
sRect.left = 5;
sRect.top = 5;
sRect.right = 100;
sRect.bottom = 20;
_g_pFont -> DrawText(0, _fpsString, -1, &sRect, DT_LEFT | DT_TOP, 0xffffff00 );
}
现在问题出来了.为什么加入字体来显示fps后,雾化效果就没了.
把TheFPS.DrawFont();注释掉,雾化就又有了.请问哪出问题了........请指点一下~~~~~~谢谢 |
|