|
//CFont的字体初始化
HRESULT hr = D3DXCreateFont(m_pDevice,nHeight,0,0,true,FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH|FF_DONTCARE,
pName,
&m_pFont
);
//字体渲染
RECT destRect;
SetRect( &destRect, x, y, 100, 100 );
m_pFont->DrawText( NULL, fps, -1, &destRect, DT_NOCLIP,
D3DXCOLOR( 1.0f, 0.0f, 0.0f, 1.0f ) );
//雾的设置
ChangeRenderState( m_pDevice, D3DRS_FOGCOLOR,
D3DCOLOR_XRGB( 122, 122, 122 ) );
ChangeRenderState( m_pDevice, D3DRS_FOGTABLEMODE, D3DFOG_LINEAR );
ChangeRenderState( m_pDevice, D3DRS_FOGSTART, F2DW(fFogStart) );
ChangeRenderState( m_pDevice, D3DRS_FOGEND, F2D(fFogEnd) );
大概就是这个情况,奇怪的是一调用字体的DrawText方法
就没有雾化的效果了.求高手解答下. |
|