ID3D11DeviceContext::RSGetViewports Method

Gets the array of viewports bound to the rasterizer stage.

Syntax

public:
void RSGetViewports(
         UINT *pNumViewports,
         D3D11_VIEWPORT *pViewports
)  

Parameters

pNumViewports
Type: UINT *

[in, out] A pointer to a variable that, on input, specifies the number of viewports (ranges from 0 to D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) in the pViewports array; on output, the variable contains the actual number of viewports that are bound to the rasterizer stage. If pViewports is NULL, RSGetViewports fills the variable with the number of viewports currently bound.

Xbox One: If you pass NULL to the pViewports parameter, the pNumViewports parameter will be populated with the number of viewports bound to the rasterizer stage. Note that the Direct3D Monolithic driver will always report at least one viewport, even if you explicitly set zero viewports by calling ID3D11DeviceContext::RSSetViewports.

pViewports
Type: D3D11_VIEWPORT *

[out, optional] An array of D3D11_VIEWPORT structures for the viewports that are bound to the rasterizer stage. If the number of viewports (in the variable to which pNumViewports points) is greater than the actual number of viewports currently bound, unused elements of the array contain 0. For info about how the viewport size depends on the device feature level, which has changed between Direct3D 11 and Direct3D 10, see D3D11_VIEWPORT.

Return value

None.

Remarks

In Xbox One:

Requirements

Header: Declared in d3d11_x.h (d3d11.h on other Windows platforms).

Library: Use d3d11_x.lib (d3d11.lib on other Windows platforms).

See also

ID3D11DeviceContext

ID3D11DeviceContext Members