1GLVIEWPORT(3G)                                                  GLVIEWPORT(3G)
2
3
4

NAME

6       glViewport - set the viewport
7
8

C SPECIFICATION

10       void glViewport( GLint x,
11                        GLint y,
12                        GLsizei width,
13                        GLsizei height )
14
15

PARAMETERS

17       x, y Specify  the  lower left corner of the viewport rectangle, in pix‐
18            els. The initial value is (0,0).
19
20       width, height
21            Specify the width and height of the viewport.  When a  GL  context
22            is  first  attached  to  a window, width and height are set to the
23            dimensions of that window.
24

DESCRIPTION

26       glViewport specifies the affine transformation of x and y from  normal‐
27       ized  device coordinates to window coordinates.  Let (xnd, ynd) be nor‐
28       malized device coordinates.  Then the window coordinates (xw,  yw)  are
29       computed as follows:
30
31                                 xw=(xnd+1)⎛⎝w_i_d2_t_h_⎞⎠+x
32
33                                yw=(ynd+1)⎛⎝h_e_i_g2_h_t_⎞⎠+y
34
35Viewport  width and height are silently clamped to a range that depends on the
36implementation.    To   query   this   range,   call   glGet   with   argument

GL_MAX_VIEWPORT_DIMS.

38

ERRORS

40       GL_INVALID_VALUE is generated if either width or height is negative.
41
42       GL_INVALID_OPERATION is generated if glViewport is executed between the
43       execution of glBegin and the corresponding execution of glEnd.
44

ASSOCIATED GETS

46       glGet with argument GL_VIEWPORT
47       glGet with argument GL_MAX_VIEWPORT_DIMS
48

SEE ALSO

50       glDepthRange(3G)
51
52
53
54                                                                GLVIEWPORT(3G)
Impressum