Sets the viewport used for transformations and clipping.
- iOS 8.0+
- macOS 10.11+
- tvOS 9.0+
The viewport used for transformations and clipping.
The viewport transforms vertices from normalized device coordinates to window coordinates. It also clips fragments that lie outside of its boundaries.
The x/y rectangle of the viewport must lie entirely within the current attachment size. The values for
zfar must be between
1, respectively. Flipping is allowed.
The default values for the viewport are
width = w;
height = h;
znear = 0; and
zfar = 1, where
h are the x and y dimensions of the attachment, respectively.