Information
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.

ID3D11DeviceContext::RSSetViewports method

Bind an array of viewports to the rasterizer stage of the pipeline.

Syntax


void RSSetViewports(
  [in]  UINT NumViewports,
  [in]  const D3D11_VIEWPORT *pViewports
);

Parameters

NumViewports [in]

Type: UINT

Number of viewports to bind.

pViewports [in]

Type: const D3D11_VIEWPORT*

An array of D3D11_VIEWPORT structures to bind to the device. See the structure page for details about how the viewport size is dependent on the device feature level which has changed between Direct3D 11 and Direct3D 10.

Return value

Returns nothing.

Remarks

All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.

Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.

Note  Even though you specify float values to the members of the D3D11_VIEWPORT structure for the pViewports array in a call to ID3D11DeviceContext::RSSetViewports for feature levels 9_x, RSSetViewports uses DWORDs internally. Because of this behavior, when you use a negative top left corner for the viewport, the call to RSSetViewports for feature levels 9_x fails. This failure occurs because RSSetViewports for 9_x casts the floating point values into unsigned integers without validation, which results in integer overflow.

Windows Phone 8: This API is supported.

Requirements

Header

D3D11.h

Library

D3D11.lib

See also

ID3D11DeviceContext

 

 

Community Additions

Show:
© 2014 Microsoft