GlViewport: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "'''_glViewport:''' set the viewport {{PageSyntax}} SUB _glViewport (BYVAL x AS LONG, BYVAL y AS LONG, BYVAL width AS LONG, BYVAL height AS LONG) void '''_glViewport'''(GLint {{Parameter|x}}, GLint {{Parameter|y}}, GLsizei {{Parameter|width}}, GLsizei {{Parameter|height}}); ; x, y : Specify the lower left corner of the viewport rectangle, in pixels. The initial value is (0,0). ; width, height : Specify the width and height of the viewport. When a GL context is fi...")
 
No edit summary
Line 43: Line 43:
{{PageCopyright}}
{{PageCopyright}}


Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/].
 
{{PageNavigation}}

Revision as of 13:01, 5 May 2022

_glViewport: set the viewport


Syntax

 SUB _glViewport (BYVAL x AS LONG, BYVAL y AS LONG, BYVAL width AS LONG, BYVAL height AS LONG)
 void _glViewport(GLint x, GLint y, GLsizei width, GLsizei height);


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


Description

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

Template:Glapi viewport equations

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


Template:PageErrors

Template:KW is generated if either width or height is negative.


Template:PageUseWith

Template:KW with argument Template:KW

Template:KW with argument Template:KW


See also

SUB _GL Template:KW, Template:KW, Template:KW


Template:PageCopyright



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link