Platform SDK: DirectX

ID3DXContext::SetClearColor

The ID3DXContext::SetClearColor method sets the color to which the render target surface will be cleared.

HRESULT SetClearColor( 
  D3DCOLOR color
); 

Parameters

color
A D3DCOLOR type representing the value to which the render target surface will be cleared. The default value is 0.

Return Values

This method returns S_OK.

Remarks

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.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Version: Requires DirectX 7.0.
  Header: Declared in d3dxcore.h.
  Library: Use d3dx.lib.

See Also

ID3DXContext::Clear, ID3DXContext::SetClearDepth, ID3DXContext::SetClearStencil