DirectX SDK

ID3DXContext::SetClearDepth

The ID3DXContext::SetClearDepth method sets the value to which the depth-buffer surface will be cleared.

HRESULT SetClearDepth( 
  float z
); 

Parameters

z
New z value stored in the depth buffer. This parameter can range from 0.0 to 1.0, inclusive (for z-based or w-based depth buffers). The value of 0.0 represents the nearest distance to the viewer, and 1.0 the farthest distance. The default value is 1.0f.

Return Values

This method returns S_OK.

Remarks

After setting the z value stored in the depth buffer with this method, you can call the ID3DXContext::Clear method to clear the depth-buffer surface to this value.

Requirements

  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.

See Also

ID3DXContext::Clear, ID3DXContext::SetClearColor, ID3DXContext::SetClearStencil