ID3D10Device::CreateDepthStencilView method (d3d10.h)

Create a depth-stencil view for accessing resource data.

Syntax

HRESULT CreateDepthStencilView(
  [in]  ID3D10Resource                      *pResource,
  [in]  const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
  [out] ID3D10DepthStencilView              **ppDepthStencilView
);

Parameters

[in] pResource

Type: ID3D10Resource*

Pointer to the resource that will serve as the depth-stencil surface. This resource must have been created with the D3D10_BIND_DEPTH_STENCIL flag.

[in] pDesc

Type: const D3D10_DEPTH_STENCIL_VIEW_DESC*

Pointer to a depth-stencil-view description (see D3D10_DEPTH_STENCIL_VIEW_DESC). Set this parameter to NULL to create a view that accesses mipmap level 0 of the entire resource (using the format the resource was created with).

[out] ppDepthStencilView

Type: ID3D10DepthStencilView**

Address of a pointer to an ID3D10DepthStencilView. Set this parameter to NULL to validate the other input parameters (the method will return S_FALSE if the other input parameters pass validation).

Return value

Type: HRESULT

This method returns one of the following Direct3D 10 Return Codes.

Remarks

A depth-stencil view can be bound to the output-merger stage by calling ID3D10Device::OMSetRenderTargets.

For more background information, see the programming guide page about depth stencils.

Requirements

Requirement Value
Target Platform Windows
Header d3d10.h
Library D3D10.lib

See also

ID3D10Device Interface