GLINDEXMASK(3G)

πŸ“¦ version 1.1, in centos-stream 9, fedora 43, fedora 44

πŸ’… GLINDEXMASK β€” ok so this is from the 3G manual, bestie, and it's literally about controlling which bits get written in your color index buffers ✨


πŸŽ€ NAME πŸŽ€

glIndexMask β€” control the writing of individual bits in the color index buffers πŸ’–

Like, individual bits. Not the whole buffer. We're being ✨precise✨ today.


🌸 C SPECIFICATION 🌸

void glIndexMask( GLuint mask )

That's it. One argument. So demure. So mindful. 🧚


πŸ¦‹ PARAMETERS πŸ¦‹

  • mask β€” specifies a bit mask that enables and disables the writing of individual bits in the color index buffers. Initially, the mask is all 1's. (yes babe, all ones, everything unlocked, the whole buffet πŸ“)

✨ DESCRIPTION ✨

Okay so here's the tea, bestie πŸ«– β€” glIndexMask controls the writing of individual bits in the color index buffers.

The least significant n bits of mask β€” where n is the number of bits in a color index buffer β€” specify a mask. So it's like, the mask matches the buffer size, iykyk.

Where a 1 (one) appears in the mask, it's possible to write to the corresponding bit in the color index buffer (or buffers) πŸ”₯. Where a 0 (zero) appears, the corresponding bit is write-protected 🚫 β€” hands off, that bit said no.

This mask is used only in color index mode πŸ‘‘ β€” not RGB mode, don't get it twisted. And it affects only the buffers currently selected for writing (see glDrawBuffer). Initially, all bits are enabled for writing, no cap πŸ’―.


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_OPERATION is generated if glIndexMask is executed between the execution of glBegin and the corresponding execution of glEnd.
fr fr do not call this inside a glBegin/glEnd block. The GL will literally yell at you. 🚨

πŸ” ASSOCIATED GETS πŸ”

  • glGet with argument GL_INDEX_WRITEMASK

(the way you can just ask the GL what your mask is, obsessed 🌈)


🌟 SEE ALSO 🌟

  • glColorMask(3G)
  • glDepthMask(3G)
  • glDrawBuffer(3G)
  • glIndex(3G)
  • glIndexPointer(3G)
  • glStencilMask(3G)

Go read those too, they're all part of the mask squad πŸ’œ


okay that's the whole page bestie, no notes πŸ’…βœ¨

And a lil sign-off from me to you: this one lives under the GLINDEXMASK(3G) name in the 3G manual β€” same title up top, same title at the bottom, iconic symmetrical moment πŸ‘‘πŸ¦‹πŸ’–

πŸ“¦ where this page comes from