Method glViewport
glViewport(int, int, int, int)
Sets the viewport for rendering in OpenGL.
public static extern void glViewport(int x, int y, int width, int height)
Parameters
xintThe x-coordinate of the lower-left corner of the viewport, in pixels.
yintThe y-coordinate of the lower-left corner of the viewport, in pixels.
widthintThe width of the viewport, in pixels. Must be greater than or equal to 0.
heightintThe height of the viewport, in pixels. Must be greater than or equal to 0.
Remarks
The viewport specifies the affine transformation of normalized device coordinates to window coordinates. It defines the rectangular region of the window where OpenGL will draw. Typically, this method is called during initialization or when the window is resized.