Specifies x coordinate of the lower left corner of the viewport rectangle. The initial value is 0.
Specifies y coordinate of the lower left corner of the viewport rectangle. The initial value is 0.
Specifies the width of the viewport. When a GL context is first attached to a window, width is set to the width of that window.
Specifies the height of the viewport. When a GL context is first attached to a window, height is set to the height of that window.
Generated using TypeDoc
glViewport
specifies the affine transformation of 𝐱 and 𝐲 from normalized device coordinates to window coordinates. Let (𝐱ₙ𝑑, 𝐲ₙ𝑑) be normalized device coordinates. Then the window coordinates (𝐱𝑤, 𝐲𝑤) are computed as follows:𝐱𝑤 = (𝐱ₙ𝑑 + 1)(width / 2) + 𝐱
𝐲𝑤 = (𝐲ₙ𝑑 + 1)(height / 2) + 𝐲
Viewport width and height are silently clamped to a range that depends on the implementation. To query this range, call glGet with argument GL_MAX_VIEWPORT_DIMS.