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

NAME

6       glViewport - set the viewport
7

C SPECIFICATION

9       void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
10

PARAMETERS

12       x, y
13           Specify the lower left corner of the viewport rectangle, in pixels.
14           The initial value is (0,0).
15
16       width, height
17           Specify the width and height of the viewport. When a GL context is
18           first attached to a window, width and height are set to the
19           dimensions of that window.
20

DESCRIPTION

22       glViewport specifies the affine transformation of x and y from
23       normalized device coordinates to window coordinates. Let x nd y nd be
24       normalized device coordinates. Then the window coordinates x w y w are
25       computed as follows:
26
27       x w = x nd + 1 ⁢ width 2 + x
28
29       y w = y nd + 1 ⁢ height 2 + y
30
31       Viewport width and height are silently clamped to a range that depends
32       on the implementation. To query this range, call glGet() with argument
33       GL_MAX_VIEWPORT_DIMS.
34

ERRORS

36       GL_INVALID_VALUE is generated if either width or height is negative.
37

ASSOCIATED GETS

39       glGet() with argument GL_VIEWPORT
40
41       glGet() with argument GL_MAX_VIEWPORT_DIMS
42

SEE ALSO

44       glDepthRange()
45
47       Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
48       under the SGI Free Software B License. For details, see
49       http://oss.sgi.com/projects/FreeB/.
50

AUTHORS

52       opengl.org
53
54
55
56opengl.org                        06/10/2014                    GLVIEWPORT(3G)
Impressum