GLSCISSOR(3G)
π glScissor(3G) β like, the scissor box one π
okay bestie, buckle up, this is a page from the 3G manual (that's the OpenGL section of the man pages, iykyk) and it's about glScissor. It's short, it's iconic, it's literally the rectangle that decides which pixels are allowed to exist. Let's go β¨
πΈ NAME πΈ
glScissor β define the scissor box
π§ C SPECIFICATION π§
void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
That's the whole signature, no cap. Four args, all numbers, all important π«Ά
π PARAMETERS π
x,yβ these two specify the lower left corner of the scissor box. Initially they're(0, 0), which is the classic "start at the bottom-left, main character energy" default.width,heightβ these specify the width and height of the scissor box. And here's the cute part: when a GL context is first attached to a window,widthandheightare set to the dimensions of that window. Like, it just matches the window automatically at first. Obsessed π
β¨ DESCRIPTION β¨
So glScissor defines a rectangle β they call it the scissor box β and it lives 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. Boom, that's a rectangle π
To enable and disable the scissor test, call glEnable() and
glDisable with argument GL_SCISSOR_TEST. (Yes, that's literally how it's written on the page β the sentence got split across a line break, she's fine, she's just dramatic π)
The test is initially disabled. While the test is enabled, only pixels that lie within the scissor box can be modified by drawing commands. Everything outside? Not invited to the party π
Window coordinates have integer values at the shared corners of frame buffer pixels. So that means:
glScissor(0,0,1,1)allows modification of only the lower left pixel in the window β one single pixel, one single queen πglScissor(0,0,0,0)doesn't allow modification of any pixels in the window. Zero pixels. Nothing. The void. π
And when the scissor test is disabled, it is as though the scissor box includes the entire window β like the box just stretched out and took over the whole screen, which honestly is a mood π¦
π ERRORS π
GL_INVALID_VALUEis generated if eitherwidthorheightis negative.
fr fr, don't pass a negative size. That's a whole error, not a vibe. β οΈ
π₯ ASSOCIATED GETS π₯
glGet()with argumentGL_SCISSOR_BOXglIsEnabled()with argumentGL_SCISSOR_TEST
Use these to peek at the current scissor box and check whether the test is on. Slay π
π VERSION SUPPORT π
Here's the vibe check for glScissor across the OpenGL versions β the function name column is glScissor, and it's a full sweep:
| was a table, now it's a list because we don't do tables here π |
- Function / Feature Name:
glScissor - OpenGL 2.0: β
- OpenGL 2.1: β
- OpenGL 3.0: β
- OpenGL 3.1: β
- OpenGL 3.2: β
- OpenGL 3.3: β
- OpenGL 4.0: β
- OpenGL 4.1: β
- OpenGL 4.2: β
- OpenGL 4.3: β
- OpenGL 4.4: β
- OpenGL 4.5: β
Every column. Every check. She ate and left no crumbs π½οΈβ¨
π SEE ALSO π
glEnable()glViewport()
Go read those next, bestie, they're friends of hers π«Ά
π COPYRIGHT π
Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.
π COPYRIGHT (again, yes really) π
Copyright Β© 1991-2006 Silicon Graphics, Inc.
Copyright Β© 2010-2014 Khronos Group
So the page lists COPYRIGHT twice β once with the license bit, once just the holders. Not me making the same joke twice, it's in the source, I promise π
okay that's the whole page!! luv u, go clip some rectangles πβ¨ππ¦πΈπ
[FIXME: source] β’ 08/09/2021 β’ GLSCISSOR(3G) β that's the footer, mwah π
π¦ 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