DirectX SDK |
The ID3DXContext::SetClearColor method sets the color to which the render target surface will be cleared.
HRESULT SetClearColor( D3DCOLOR color );
This method returns S_OK.
The D3DRGBA macro can be used to specify the color in this method:
hr = m_pD3DX->SetClearColor(D3DRGBA(0.5f,0.0f,0.0f,0));
After setting the color of the render target surface with this method, you can call the ID3DXContext::Clear method to clear the viewport to this color.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Version: Requires DirectX 7.0.
Header: Declared in d3dxcore.h.
Library: Use d3dx.lib.
ID3DXContext::Clear, ID3DXContext::SetClearDepth, ID3DXContext::SetClearStencil