robot_2Generated
code_blocksInput

Description

The ViewportSize property provides a handle to the current size of the viewport. This handle is of type RenderTargetHandle.SizeHandle and is used to manage and access the dimensions of the rendering viewport within the CommandList class.

Usage

Use the ViewportSize property when you need to retrieve or manipulate the size of the viewport in rendering operations. This is particularly useful when setting up rendering targets or when you need to adjust rendering parameters based on the viewport dimensions.

Example

// Example of accessing the ViewportSize property
var commandList = new CommandList();
var viewportSizeHandle = commandList.ViewportSize;

// Use the viewportSizeHandle to perform operations related to the viewport size
// For example, setting up a render target based on the viewport size
var renderTarget = commandList.GetRenderTarget("MainRenderTarget", ImageFormat.RGBA8, 1, viewportSizeHandle);