mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-07 10:40:17 +00:00
Note: Many files were removed (not yet existing/empty pages). The parser will try to download them on demand and will auto-generate text for missing pages (eg. most _gl pages).
50 lines
1.6 KiB
Text
50 lines
1.6 KiB
Text
{{QBDLDATE:05-20-2022}}
|
|
{{QBDLTIME:23:24:35}}
|
|
{{DISPLAYTITLE:_glViewport}}
|
|
'''_glViewport:''' set the viewport
|
|
|
|
|
|
{{PageSyntax}}
|
|
|
|
;QB64:SUB _glViewport (BYVAL x AS LONG, BYVAL y AS LONG, BYVAL width AS LONG, BYVAL height AS LONG)
|
|
;C/C++: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 first attached to a window, {{Parameter|width}} and {{Parameter|height}} are set to the dimensions of that window.
|
|
|
|
|
|
{{PageDescription}}
|
|
|
|
'''_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:
|
|
|
|
{{glapi viewport equations}}
|
|
|
|
Viewport width and height are silently clamped to a range that depends on the implementation. To query this range, call {{KW|_glGet}} with argument {{KW|_GL_MAX_VIEWPORT_DIMS}}.
|
|
|
|
|
|
{{PageErrors}}
|
|
|
|
{{KW|_GL_INVALID_VALUE}} is generated if either {{Parameter|width}} or {{Parameter|height}} is negative.
|
|
|
|
|
|
{{PageUseWith}}
|
|
|
|
{{KW|_glGet}} with argument {{KW|_GL_VIEWPORT}}
|
|
|
|
{{KW|_glGet}} with argument {{KW|_GL_MAX_VIEWPORT_DIMS}}
|
|
|
|
|
|
{{PageSeeAlso}}
|
|
|
|
[[_GL|SUB _GL]]
|
|
{{KW|_glDepthRange}}, {{KW|_glViewportArray}}, {{KW|_glViewportIndexed}}
|
|
|
|
|
|
{{PageCopyright}}
|
|
|
|
|
|
{{PageNavigation}}
|
|
|