Structure

MTLViewport

A 3D rectangular region for the viewport clipping.

Declaration

typedef struct {
    ...
} MTLViewport;

Topics

Specifying Viewport Boundaries

originX

The x coordinate of the upper-left corner of the viewport.

originY

The y coordinate of the upper-left corner of the viewport.

width

The width of the viewport, in pixels.

height

The height of the viewport, in pixels.

znear

The z coordinate of the near clipping plane of the viewport.

zfar

The z coordinate of the far clipping plane of the viewport.

See Also

Setting Viewport and Scissor Behavior

Rendering to Multiple Viewports in a Draw Command

Select viewports and their corresponding scissor rectangles in your vertex shader.

- setViewport:

Sets the viewport used for transformations and clipping.

Required.

- setViewports:count:

Sets an array of viewports.

Required.

- setScissorRect:

Sets the scissor rectangle for a fragment scissor test.

Required.

- setScissorRects:count:

Sets an array of scissor rectangles.

Required.

MTLScissorRect

A rectangle for the scissor fragment test.