GLCOLORMASK(3G)

🌈 GLCOLORMASK(3G) β€” the 3G manual, bestie πŸ’…

okay so real talk: this is the page for glColorMask and glColorMaski, living in the 3G manual. It's all about turning the writing of frame buffer color components on and off. iconic behaviour, honestly.


✨ NAME ✨

glColorMask, _glColorMaski β€” enable and disable writing of frame buffer color components 🎨


🫢 C SPECIFICATION 🫢

void glColorMask(GLboolean red, GLboolean green, GLboolean blue,
                 GLboolean alpha);

void glColorMaski(GLuint buf, GLboolean red, GLboolean green,
                  GLboolean blue, GLboolean alpha);

πŸŽ€ PARAMETERS πŸŽ€

  • buf β€” for glColorMaski, this is the index of the draw buffer whose color mask you're setting. like, which one bestie. πŸ‘€
  • red, green, blue, alpha β€” these say whether red, green, blue and alpha get written into the frame buffer. the initial values are all GL_TRUE, meaning yes, the color components are being written. as they should. πŸ’–

πŸ”₯ DESCRIPTION πŸ”₯

So glColorMask and glColorMaski specify whether the individual color components in the frame buffer can or cannot be written. that's the whole vibe check.

glColorMaski sets the mask for one specific draw buffer, whereas glColorMask sets the mask for all the draw buffers. main character energy vs. group chat energy, lowkey.

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 you attempted. like, it's just not happening. periodt. 🚫

⚠️ heads up: changes to individual bits of components cannot be controlled. it's giving all-or-nothing. rather, changes are either enabled or disabled for entire color components. no in-between, no partial slay. πŸ’€

🌸 ASSOCIATED GETS 🌸

glGet() with argument GL_COLOR_WRITEMASK β€” that's how you peek at it, iykyk πŸ•΅οΈ


πŸ‘‘ VERSION SUPPORT πŸ‘‘

okay so here's the tea, version by version β˜• (ranges are inclusive, no cap):

glColorMask β€” fully supported, all checkmarks βœ” from 2.0 through 4.5. every single one: 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5. ate. πŸ’…

glColorMaski β€” not a thing in 2.0 and 2.1 (marked -), then supported βœ” from 3.0 all the way to 4.5: 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5. glow-up arc fr fr ✨


πŸ¦‹ SEE ALSO πŸ¦‹

  • glClear()
  • glDepthMask()
  • glStencilMask()

go read those too, bestie, they're all in the same friend group 🫢


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 Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group


okay that's the whole page!! πŸŽ€ source was [FIXME: source] and it's dated 08/09/2021 β€” so this info is from back in 2021, still iconic tho. mwah πŸ’‹ βœ¨πŸ“πŸŒ·

πŸ“¦ where this page comes from