GLSCISSOR(3G)

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

🌸 NAME 🌸

okay bestie, welcome to the GLSCISSOR(3G) page β€” we're talking about glScissor, the little icon that defines the scissor box. πŸ’…

πŸ’» C SPECIFICATION πŸ’»

       void glScissor( GLint x,
                       GLint y,
                       GLsizei width,
                       GLsizei height )

✨ PARAMETERS ✨

  • x, y β€” these specify the lower left corner of the scissor box. Initially, they're (0, 0) β€” yes, that's the starting vibe. 🫢
  • width, height β€” these specify the width and height of the scissor box. When a GL context is first attached to a window, width and height are set to the dimensions of that window. periodt. πŸͺŸ

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so glScissor defines a rectangle β€” the scissor box β€” in window coordinates. The first two arguments, x and y, specify the lower left corner of the box. width and height specify the width and height of the box. it's giving precise rectangle energy. πŸ“

To enable and disable the scissor test, call glEnable and glDisable with argument GL_SCISSOR_TEST. The test is initially disabled. While the test is enabled, only pixels that lie within the scissor box can be modified by drawing commands. lowkey a pixel bouncer. πŸšͺ✨

Window coordinates have integer values at the shared corners of frame buffer pixels. So glScissor(0,0,1,1) allows modification of only the lower left pixel in the window, and glScissor(0,0,0,0) doesn't allow modification of any pixels in the window. not even one, bestie. 😭

When the scissor test is disabled, it is as though the scissor box includes the entire window. iconic default behavior, ngl. 🌈

πŸ’€ ERRORS πŸ’€

  • GL_INVALID_VALUE is generated if either width or height is negative. no negative dimensions, bestie β€” that's the rule. 🚫
  • GL_INVALID_OPERATION is generated if glScissor is executed between the execution of glBegin and the corresponding execution of glEnd. do not try it in the middle of that pair, fr fr. πŸ™ˆ

πŸ‘‘ ASSOCIATED GETS πŸ‘‘

  • glGet with argument GL_SCISSOR_BOX
  • glIsEnabled with argument GL_SCISSOR_TEST

these are the little check-in tools. iykyk. πŸ”

πŸŽ€ SEE ALSO πŸŽ€

  • glEnable(3G)
  • glViewport(3G)

go read these next, bestie β€” they're part of the same friend group. 🫢


πŸ’– footer tea: this page signs off under the GLSCISSOR(3G) tag, with no extra source/version/date deets to spill β€” byeee bestie! πŸ’–

πŸ“¦ where this page comes from