DirectX SDK |
The ID3DXContext::Clear method clears specified surfaces from the current viewport.
HRESULT Clear( DWORD ClearFlags );
If the method succeeds, the return value is S_OK.
If the method fails, the return value may be one of the following values:
D3DERR_STENCILBUFFER_NOTPRESENT |
D3DERR_VIEWPORTHASNODEVICE |
D3DERR_ZBUFFER_NOTPRESENT |
DDERR_INVALIDOBJECT |
DDERR_INVALIDPARAMS |
This method fails if you specify the D3DCLEAR_ZBUFFER or D3DCLEAR_STENCIL flags when the render target does not have an attached depth-buffer. Similarly, if you specify the D3DCLEAR_STENCIL flag when the depth-buffer format doesn't contain stencil buffer information, this method fails.
This method clears to the current viewport. Specify the color the viewport clears to with the ID3DXContext::SetClearColor method, the value the depth buffer clear to with the ID3DXContext::SetClearDepth method, and the value the stencil buffer clears to with ID3DXContext::SetClearStencil method.
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::SetClearColor, ID3DXContext::SetClearDepth, ID3DXContext::SetClearStencil