glViewport

Definition: include pGUI.e
include opengl.e

glViewport(integer x, y, w, h)
Description: The glViewport function sets the viewport.

x,y: The lower-left corner of the viewport rectangle, in pixels. The default is (0,0).
width,height: The width and height of the viewport.
When an OpenGL context is first attached to a window, width and height are set to the dimensions of that window.

If either width or height was negative, glGetError() will return GL_INVALID_VALUE.
If this routine is called between glBegin and glEnd, glGetError() will return GL_INVALID_OPERATION.
Remarks The glViewport function specifies the affine transformation of x and y from normalized device coordinates to window coordinates.
Let (xnd, ynd) be normalized device coordinates.
The window coordinates (xw, yw) are then computed as follows:


Viewport width and height are silently clamped to a range that depends on the implementation.
This range is queried by calling glGet with argument GL_MAX_VIEWPORT_DIMS.

The following functions retrieve information related to glViewport:
glGet with argument GL_VIEWPORT
glGet with argument GL_MAX_VIEWPORT_DIMS
See Also: glBegin, int_to_bits
DEV See also --glBegin glDepthRange