Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ID3D10Device::ClearRenderTargetView method

Set all the elements in a render target to one value.


void ClearRenderTargetView(
  [in]       ID3D10RenderTargetView *pRenderTargetView,
  [inconst FLOAT                  ColorRGBA[4]


pRenderTargetView [in]

Type: ID3D10RenderTargetView*

Pointer to the render target.

ColorRGBA[4] [in]

Type: const FLOAT

A 4-component array that represents the color to fill the render target with.

Return value

Returns nothing.


Applications that wish to clear a render target to a specific integer value bit pattern should render a screen-aligned quad instead of using this method. The reason for this is because this method accepts as input a floating point value, which may not have the same bit pattern as the original integer.

Differences between Direct3D 9 and Direct3D 10:

Unlike Direct3D 9, the full extent of the resource view is always cleared. Viewport and scissor settings are not applied.


When using 10Level9, ClearRenderTargetView only clears the first array slice in the render target view. This can impact (for example) cube map rendering scenarios. Applications should create a render target view for each face or array slice, then clear each view individually.






See also

ID3D10Device Interface



© 2018 Microsoft