GLCLEARSTENCIL(3G)

πŸ’… GLCLEARSTENCIL πŸ’…

okay so bestie, we're in the 3G manual today and the star of the show is glClearStencil β€” yes, that's the whole vibe, and honestly? it ate.


✨ NAME ✨

glClearStencil β€” specify the clear value for the stencil buffer πŸŽ€


🧚 C SPECIFICATION 🧚

void glClearStencil(GLint s);

that's it. that's the whole function signature. iconic minimalism. πŸ’…


🌸 PARAMETERS 🌸

  • s β€” the index used when the stencil buffer is cleared. the initial value is 0. yes, zero, the main character of default values. πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: glClearStencil specifies the index that glClear() uses to clear the stencil buffer. that's its whole job and it does it flawlessly, no notes. 🫢

now the little technical moment β€” s gets masked with 2^m - 1, where m is the number of bits in the stencil buffer. like, it's giving bitwise filter, and honestly it's lowkey slay of the spec to just tell you that straight up. ✨


⭐ ASSOCIATED GETS ⭐

  • glGet() with argument GL_STENCIL_CLEAR_VALUE
  • glGet() with argument GL_STENCIL_BITS

go get your values, bestie, they're right there. πŸ”


πŸ”₯ VERSION SUPPORT πŸ”₯

the function/feature name in question is glClearStencil, and the OpenGL versions are 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, and 4.5. and the support? literally every single one of them. not one flop in the bunch:

  • glClearStencil β€” OpenGL 2.0 β€” βœ”
  • glClearStencil β€” OpenGL 2.1 β€” βœ”
  • glClearStencil β€” OpenGL 3.0 β€” βœ”
  • glClearStencil β€” OpenGL 3.1 β€” βœ”
  • glClearStencil β€” OpenGL 3.2 β€” βœ”
  • glClearStencil β€” OpenGL 3.3 β€” βœ”
  • glClearStencil β€” OpenGL 4.0 β€” βœ”
  • glClearStencil β€” OpenGL 4.1 β€” βœ”
  • glClearStencil β€” OpenGL 4.2 β€” βœ”
  • glClearStencil β€” OpenGL 4.3 β€” βœ”
  • glClearStencil β€” OpenGL 4.4 β€” βœ”
  • glClearStencil β€” OpenGL 4.5 β€” βœ”

twelve for twelve. undefeated. no cap. πŸ‘‘πŸ’€


🌈 SEE ALSO 🌈

like, go read these too, they're all in the same friend group:

  • glClear()
  • glStencilFunc()
  • glStencilFuncSeparate()
  • glStencilMask()
  • glStencilMaskSeparate()
  • glStencilOp()
  • glStencilOpSeparate()

iykyk. 🧚


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


legal stuff is not the vibe but we respect it fr fr β€” the SGI Free Software B License is the moment here, and the link is right there for the details. 🫑

okay that's the whole page, go clear some stencil buffers, you're gonna do amazing πŸ’–βœ¨

and a lil sign-off for the credits: this came from [FIXME: source], dated 08/09/2021, in the GLCLEARSTENCIL(3G) manual. periodt. πŸ’…πŸŽ€

πŸ“¦ where this page comes from