GLCOLORMASK(3G)
β¨ GLCOLORMASK(3G) β¨
okay bestie, sit down, hydrate, because we're talking about glColorMask from the 3G manual section and she is literally the bouncer at the door of your frame buffer's color channels π
π NAME π
glColorMask β enable and disable writing of frame buffer color components
so yeah, she's the girl who decides which color components are even allowed to be written. gatekeeping, but make it graphics π
π C SPECIFICATION π
void glColorMask( GLboolean red,
GLboolean green,
GLboolean blue,
GLboolean alpha )
look at her. four little booleans. so much power π«Ά
πΈ PARAMETERS πΈ
red,green,blue,alphaβ these four cuties specify whether red, green, blue, and alpha can or cannot be written into the frame buffer. and the initial values? allGL_TRUE, bestie. every single one. meaning yes, all the color components can be written right out of the gate. permission granted, no questions asked β¨
π¦ DESCRIPTION π¦
so glColorMask specifies whether the individual color components in the frame buffer can or cannot be written. it's giving very selective. very "I choose who gets in" π
if red is GL_FALSE, for example, then no change is made to the red component of any pixel in any of the color buffers, regardless of the drawing operation attempted. like, you can try. you can try so hard. the red channel is not hearing it. not today. not ever. periodt π
and here's the thing β changes to individual bits of components cannot be controlled. nope. can't do it. instead, changes are either enabled or disabled for entire color components. it's all or nothing, babe. whole component or no component. no half measures, no in-between, no "just a little bit of red" π
π ERRORS π
GL_INVALID_OPERATION is generated if glColorMask is executed between the execution of glBegin and the corresponding execution of glEnd.
bestie. do NOT call her mid-glBegin. she will scream.GL_INVALID_OPERATIONis the scream. wait until afterglEndlike a civilized icon π
π₯ ASSOCIATED GETS π₯
glGetwith argumentGL_COLOR_WRITEMASKglGetwith argumentGL_RGBA_MODE
these are how you ask her "so what's your current vibe, mask-wise" and she'll actually tell you π
π SEE ALSO π
glClear(3G), glColor(3G), glColorPointer(3G), glDepthMask(3G), glIndex(3G), glIndexPointer(3G), glIndexMask(3G), glStencilMask(3G)
the whole masked-up friend group. go read them too, they're all icons in their own right π
and that's the whole page, bestie β straight from the GLCOLORMASK(3G) entry in the 3G manual, footer and all. go forth and mask responsibly πβ¨
π¦ 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 on : a language model's rewrite of the original, under its terms