GLCOLORMASK(3G)

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

✨ 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? all GL_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_OPERATION is the scream. wait until after glEnd like a civilized icon 😭

πŸ”₯ ASSOCIATED GETS πŸ”₯

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