GLVIEWPORTARRAY(3G)
π GLVIEWPORTARRAY(3G) π
okay so bestie, this is glViewportArray from the [FIXME: manual] situation β yes the manual header literally says that, we love an unfinished glow-up π β and it's the page about setting multiple viewports at once. plural. a whole squad of viewports. periodt.
β¨ NAME β¨
glViewportArray β set multiple viewports π¦
πΈ C SPECIFICATION πΈ
void glViewportArrayv(GLuint first, GLsizei count, const GLfloat *v);
that's it. that's the whole signature. copy it exactly, don't get creative π
π PARAMETERS π
firstβ the index of the first viewport you wanna set. like, where the party starts.countβ how many viewports you're setting. how many besties you're bringing.vβ the address of an array holding the viewport parameters. it's the bag with everybody's stuff in it.
π DESCRIPTION π
so glViewportArrayv specifies the parameters for multiple viewports simultaneously π₯. first is the index of the first viewport to modify, and count is the number of viewports to modify. first must be less than the value of GL_MAX_VIEWPORTS, and first + count must be less than or equal to the value of GL_MAX_VIEWPORTS. viewports whose indices lie outside the range [first, first + count) are not modified β they just stay in their lane, no cap π§.
v contains the address of an array of floating point values specifying the left (x), bottom (y), width (w), and height (h) of each viewport, in that order. x and y give the location of the viewport's lower left corner, and w and h give the width and height of the viewport, respectively. the viewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. let x nd and y nd be normalized device coordinates. then the window coordinates x w y w are computed as follows:
x w = x nd + 1 β’ width 2 + x
y w = y nd + 1 β’ height 2 + y
iykyk, this is the mathy part, just copy it, don't @ me π
the location of the viewport's bottom left corner, given by (x, y), is clamped to be within the implementation-dependent viewport bounds range. the viewport bounds range [min, max] can be determined by calling glGet() with argument GL_VIEWPORT_BOUNDS_RANGE. viewport width and height are silently clamped to a range that depends on the implementation β silently, like it's not gonna tell you π. to query this range, call glGet() with argument GL_MAX_VIEWPORT_DIMS.
the precision with which the GL interprets the floating point viewport bounds is implementation-dependent and may be determined by querying the implementation-defined constant GL_VIEWPORT_SUBPIXEL_BITS β¨.
π ERRORS π
GL_INVALID_VALUEis generated iffirstis greater than or equal to the value ofGL_MAX_VIEWPORTS.GL_INVALID_VALUEis generated iffirst + countis greater than or equal to the value ofGL_MAX_VIEWPORTS.GL_INVALID_VALUEis generated if eitherwidthorheightis negative.
like, three whole ways to get read π . negative width is not the vibe, bestie.
π ASSOCIATED GETS π
glGet()with argumentGL_VIEWPORTglGet()with argumentGL_MAX_VIEWPORT_DIMSglGet()with argumentGL_VIEWPORT_BOUNDS_RANGEglGet()with argumentGL_VIEWPORT_SUBPIXEL_BITS
π VERSION SUPPORT π
the original ships this as a big table with the row label Function / Feature Name and a column header of OpenGL Version β here it is, de-tabled for your reading pleasure π:
glViewportArrayv2.0β-2.1β-3.0β-3.1β-3.2β-3.3β-4.0β-4.1ββ4.2ββ4.3ββ4.4ββ4.5ββ
so it's giving 4.1-and-up only. before that? not a thing. the -s said what they said π
π«Ά SEE ALSO π«Ά
glDepthRange()glViewport()glViewportIndexed()
go read those too, they're iconic in their own right π
β COPYRIGHT β
Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
π¦ COPYRIGHT (again, yes really) π¦
Copyright Β© 2010-2014 Khronos Group
okay that's the page bestie!! no cap, you ate that reading. the footer energy: this came from [FIXME: source] and it's dated 08/09/2021, hitting you with the GLVIEWPORTARRAY(3G) one more time on the way out πΈβ¨π«Ά
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms