HRESULT Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags);
Clears the viewport or a set of rectangles in the viewport to the current background material.
·Returns D3D_OK if successful, or an error otherwise, which may be one of the following values:
dwCount
Number of rectangles pointed to by lpRects.
lpRects
Address of an array of D3DRECT structures.
dwFlags
Flags indicating what to clear: the rendering target, the z-buffer, or both.
D3DCLEAR_TARGET Clear the rendering target to the background material (if set).
D3DCLEAR_ZBUFFER Clear the z-buffer or set it to the current background depth field (if set).