///
-
Автор темы
- #1
Привет всем! Опять //Тема спащена с другого борда
Идем в Render.cpp
Заменяем BeginRender и EndRender на код в спойлере ниже
Код:
void CRender::BeginRender()
{
m_pDevice->CreateStateBlock(D3DSBT_ALL, &m_pStateBlockDraw);
m_pDevice->CreateStateBlock(D3DSBT_ALL, &m_pStateBlockText);
if (m_pStateBlockDraw)
m_pStateBlockDraw->Capture();
m_pDevice>GetRenderState(D3DRS_COLORWRITEENABLE,&dwOld_D3DRS_COLORWRITEENABLE);
m_pDevice->SetRenderState(D3DRS_COLORWRITEENABLE, 0xffffffff);
DWORD colorwrite, srgbwrite;
m_pDevice->GetRenderState(D3DRS_COLORWRITEENABLE, &colorwrite);
m_pDevice->GetRenderState(D3DRS_SRGBWRITEENABLE, &srgbwrite);
m_pDevice->SetRenderState(D3DRS_COLORWRITEENABLE, 0xffffffff);
m_pDevice->SetRenderState(D3DRS_SRGBWRITEENABLE, false);
//draw here
}
void CRender::EndRender()
{
m_pDevice->SetRenderState(D3DRS_COLORWRITEENABLE, dwOld_D3DRS_COLORWRITEENABLE);
DWORD colorwrite, srgbwrite;
m_pDevice->SetRenderState(D3DRS_COLORWRITEENABLE, colorwrite);
m_pDevice->SetRenderState(D3DRS_SRGBWRITEENABLE, srgbwrite);
if (m_pStateBlockDraw)
{
m_pStateBlockDraw->Apply();
m_pStateBlockDraw->Release();
}
if (m_pStateBlockText)
m_pStateBlockText->Release();
}