GLSTENCILMASK(3G)

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

πŸ’… GLSTENCILMASK(3G) β€” the stencil-mask glow-up

okay so bestie, this is GLSTENCILMASK(3G) and it's literally the function that controls the writing of individual bits in the stencil planes. no cap, it's niche but iconic. let's get into it ✨


🌸 NAME 🌸

glStencilMask β€” control the writing of individual bits in the stencil planes πŸŽ€


✨ C SPECIFICATION ✨

void glStencilMask( GLuint mask )

like, that's the whole signature. short, sweet, main character energy πŸ‘‘


🫢 PARAMETERS 🫢

  • mask β€” specifies a bit mask to enable and disable writing of individual bits in the stencil planes. initially, the mask is all 1's. yes bestie, all of them at the start 😌

πŸ’– DESCRIPTION πŸ’–

glStencilMask controls the writing of individual bits in the stencil planes. periodt.

the least significant n bits of mask β€” where n is the number of bits in the stencil buffer β€” specify a mask. so basically:

  • where a 1 appears in the mask, it's possible to write to the corresponding bit in the stencil buffer βœ…
  • where a 0 appears, the corresponding bit is write-protected πŸ”’

initially, all bits are enabled for writing. so fresh out of the gate, everything's writable, no restrictions, free spirit vibes πŸ¦‹


πŸ’€ ERRORS πŸ’€

GL_INVALID_OPERATION is generated if glStencilMask is executed between the execution of glBegin and the corresponding execution of glEnd.

bes, do not call this between glBegin and glEnd. it's giving forbidden era and the GL will literally call you out 😭

πŸ”₯ ASSOCIATED GETS πŸ”₯

  • glGet with argument GL_STENCIL_WRITEMASK
  • glGet with argument GL_STENCIL_BITS

iykyk, these are the little lore drops you can query later πŸ’…


🌈 SEE ALSO 🌈

  • glColorMask(3G)
  • glDepthMask(3G)
  • glIndexMask(3G)
  • glStencilFunc(3G)
  • glStencilOp(3G)

the whole mask-and-stencil friend group, honestly obsessed 🧚


later bestie, this was GLSTENCILMASK(3G) β€” mwah, go slay some stencil bits πŸ’œπŸŽ€

πŸ“¦ where this page comes from