> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# D3D12_VIEWPORT

> Describes the dimensions of a viewport.

Describes the dimensions of a viewport.

## Syntax

```cpp theme={null}
typedef struct D3D12_VIEWPORT
{
    FLOAT TopLeftX;
    FLOAT TopLeftY;
    FLOAT Width;
    FLOAT Height;
    FLOAT MinDepth;
    FLOAT MaxDepth;
} D3D12_VIEWPORT
```

### Members

*TopLeftX*\
Type: FLOAT

X position of the left hand side of the viewport.

*TopLeftY*\
Type: FLOAT

Y position of the top of the viewport.

*Width*\
Type: FLOAT

Width of the viewport.

*Height*\
Type: FLOAT

Height of the viewport.

*MinDepth*\
Type: FLOAT

Minimum depth of the viewport. Ranges between 0 and 1.

*MaxDepth*\
Type: FLOAT

Maximum depth of the viewport. Ranges between 0 and 1.

## Remarks

Pass an array of these structures to the <i>pViewports</i> parameter  in a call to  [ID3D12GraphicsCommandList::RSSetViewports](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_rssetviewports_public) to set viewports for the display.

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

[Core Structures](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)


## Related topics

- [D3D12_FEATURE_DATA_D3D12_OPTIONS6](/reference/graphics/d3d12/structs/d3d12_feature_data_d3d12_options6_public.md)
- [D3D12_FEATURE_DATA_D3D12_OPTIONS13](/reference/graphics/d3d12/structs/d3d12_feature_data_d3d12_options13_public.md)
- [D3D12_VIEW_INSTANCE_LOCATION](/reference/graphics/d3d12/structs/d3d12_view_instance_location_public.md)
- [D3D12_VIEW_INSTANCING_DESC](/reference/graphics/d3d12/structs/d3d12_view_instancing_desc_public.md)
- [D3D12_GRAPHICS_STATES](/reference/graphics/d3d12/enums/d3d12_graphics_states_public.md)
