GLVIEWPORT(3G)

πŸ“¦ version 24.3.3, in opensuse-leap 16.0

✨ 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, width and height are 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_VALUE is generated if either width or height is negative. not the negative dimensions era, pls 😭
  • GL_INVALID_OPERATION is generated if glViewport is executed between the execution of glBegin and the corresponding execution of glEnd. read the room, bestie πŸ’€

πŸ”₯ ASSOCIATED GETS πŸ”₯

  • glGet with argument GL_VIEWPORT
  • glGet with argument GL_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