GLVIEWPORT(3G)

    .SH "NAME" glViewport - set the viewport
    .SH "C SPECIFICATION"

            .HP u void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);

    .SH "PARAMETERS"

        .PP x, y

                    Specify the lower left corner of the viewport rectangle, in pixels. The initial value is (0,0).

            .RE
            .PP width, height

                        Specify the width and height of the viewport. When a GL context is first attached to a window, width and height are set to the dimensions of that window.

                .RE

            .SH "DESCRIPTION"
                .PP glViewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let x nd y nd be normalized device coordinates. Then the window coordinates x w y w are computed as follows:
                .PP x w = x nd + 1 ⁢ width 2 + x
                .PP y w = y nd + 1 ⁢ height 2 + y
                .PP 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.

            .SH "ERRORS"
                .PP GL_INVALID_VALUE is generated if either width or height is negative.

            .SH "ASSOCIATED GETS"
                .PP glGet() with argument GL_VIEWPORT
                .PP glGet() with argument GL_MAX_VIEWPORT_DIMS

            .SH "VERSION SUPPORT"
                .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ OpenGL Version T} T{ Function / Feature Name T}:T{ 2.0 T}:T{ 2.1 T}:T{ 3.0 T}:T{ 3.1 T}:T{ 3.2 T}:T{ 3.3 T}:T{ 4.0 T}:T{ 4.1 T}:T{ 4.2 T}:T{ 4.3 T}:T{ 4.4 T}:T{ 4.5 T} l c c c c c c c c c c c c. T{ glViewport T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}

            .SH "SEE ALSO"
                .PP glDepthRange()

            .SH "COPYRIGHT"
                .PP Copyright © 1991-2006 Silicon Graphics, Inc. Copyright © 2010-2014 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see https://khronos.org/registry/OpenGL-Refpages/LICENSES/LicenseRef-FreeB.txt.

COPYRIGHT
Copyright © 1991-2006 Silicon Graphics, Inc.
Copyright © 2010-2014 Khronos Group