GLVIEWPORT(3G)
β¨ NAME β¨
okay bestie, welcome to GLVIEWPORT(3G) β the manual page for glViewport, and its whole personality is: set the viewport. Thatβs the job, thatβs the name, no cap π
π C SPECIFICATION π
the exact signature vibe, preserved character-for-character:
void glViewport( GLint x,
GLint y,
GLsizei width,
GLsizei height )
π PARAMETERS π
x,yβ specify the lower left corner of the viewport rectangle, in pixels. The initial value is(0,0). iconic starting point, honestly π«Άwidth,heightβ specify the width and height of the viewport. When a GL context is first attached to a window,widthandheightare set to the dimensions of that window. slay, automatic sizing β¨
π¦ DESCRIPTION π¦
so glViewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (xnd, ynd) be normalized device coordinates. Then the window coordinates (xw, yw) are computed as follows β and yes, Iβm keeping the printed math exactly as it appears:
xw=(xnd+1)β_____β +x
yw=(ynd+1)β______β +y
Viewport width and height are silently clamped to a range that depends on the implementation. To query this range, call glGet with argument GL_MAX_VIEWPORT_DIMS. lowkey important, bestie π
π ERRORS π
GL_INVALID_VALUEis generated if eitherwidthorheightis negative. not the negative dimensions era, pls πGL_INVALID_OPERATIONis generated ifglViewportis executed between the execution ofglBeginand the corresponding execution ofglEnd. read the room, bestie π
π₯ ASSOCIATED GETS π₯
glGetwith argumentGL_VIEWPORTglGetwith argumentGL_MAX_VIEWPORT_DIMS
π SEE ALSO π
glDepthRange(3G)
okay thatβs the whole page, bestie β the footer is just GLVIEWPORT(3G), and thereβs no extra source/version/date line in the original, so Iβm not inventing one. catch u in the next man page, mwah π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: Mesa-libGL-devel 24.1.7-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms