NAME

glViewport - set the viewport

C SPECIFICATION

void ggllVViieewwppoorrtt( GLint _x,
                 GLint _y,
                 GLsizei _w_i_d_t_h,
                 GLsizei _h_e_i_g_h_t )

delim $$

PARAMETERS

_x, _y
Specify the lower left corner of the viewport rectangle, in pixels. The initial value is (0,0).
_w_i_d_t_h, _h_e_i_g_h_t
Specify the width and height of the viewport. When a GL context is first attached to a window, _w_i_d_t_h and _h_e_i_g_h_t are set to the dimensions of that window.

DESCRIPTION

ggllVViieewwppoorrtt specifies the affine transformation of $x$ and $y$ from normalized device coordinates to window coordinates. Let ($x sub nd$, $y sub nd$) be normalized device coordinates. Then the window coordinates ($x sub w$, $y sub w$) are computed as follows:

x sub w ~=~ ( x sub nd ~+~ 1 ) left ( "width" over 2 right ) ~+~ "x"

y sub w ~=~ ( y sub nd ~+~ 1 ) left ( "height" over 2 right ) ~+~ "y"

Viewport width and height are silently clamped to a range that depends on the implementation. To query this range, call ggllGGeett with argument GGLL__MMAAXX__VVIIEEWWPPOORRTT__DDIIMMSS.

ERRORS

GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if either _w_i_d_t_h or _h_e_i_g_h_t is negative.

GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllVViieewwppoorrtt is executed between the execution of ggllBBeeggiinn and the corresponding execution of ggllEEnndd.

ASSOCIATED GETS

ggllGGeett with argument GGLL__VVIIEEWWPPOORRTT
ggllGGeett with argument GGLL__MMAAXX__VVIIEEWWPPOORRTT__DDIIMMSS

SEE ALSO

ggllDDeepptthhRRaannggee((33GG))