GLCLEAR(3G)

🌸 NAME 🌸

okay bestie, welcome to the GLCLEAR(3G) page β€” manual name is literally [FIXME: manual], no cap. The NAME is glClear β€” clear buffers to preset values. periodt. πŸ’…


✨ C SPECIFICATION ✨

void glClear(GLbitfield mask);

πŸŽ€ PARAMETERS πŸŽ€

  • mask β€” a bitwise OR of masks that tell it which buffers to clear. The three masks are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT. that's the whole vibe check. 🫢

πŸ’– DESCRIPTION πŸ’–

glClear sets the bitplane area of the window to values previously selected by glClearColor, glClearDepth, and glClearStencil. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using glDrawBuffer(). it's giving "one call, many buffers" energy fr fr. πŸ”₯

okay so the pixel ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of glClear. The scissor box bounds the cleared region. Alpha function, blend function, logical operation, stenciling, texture mapping, and depth-buffering are ignored by glClear. lowkey important: it's not doing allat. πŸ’€

glClear takes a single argument that is the bitwise OR of several values indicating which buffer is to be cleared. the values are as follows:

  • GL_COLOR_BUFFER_BIT β€” indicates the buffers currently enabled for color writing. 🌈
  • GL_DEPTH_BUFFER_BIT β€” indicates the depth buffer. πŸ¦‹
  • GL_STENCIL_BUFFER_BIT β€” indicates the stencil buffer. πŸŽ€

The value to which each buffer is cleared depends on the setting of the clear value for that buffer. iykyk. πŸ’…


🧚 NOTES 🧚

If a buffer is not present, then a glClear directed at that buffer has no effect. literally no effect, bestie β€” it's not gonna fake it. πŸ™ˆ


πŸ’€ ERRORS πŸ’€

GL_INVALID_VALUE is generated if any bit other than the three defined bits is set in mask. so bestie, do NOT sneak extra bits in there β€” that's the warning. 😭

the three defined bits are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT. keep it cute and keep it valid. πŸ’–

πŸ‘‘ ASSOCIATED GETS πŸ‘‘

  • glGet() with argument GL_DEPTH_CLEAR_VALUE
  • glGet() with argument GL_COLOR_CLEAR_VALUE
  • glGet() with argument GL_STENCIL_CLEAR_VALUE

🌈 VERSION SUPPORT 🌈

Function / Feature Name: glClear β€” and she is supported in every listed OpenGL Version, no skips: 2.0 βœ”, 2.1 βœ”, 3.0 βœ”, 3.1 βœ”, 3.2 βœ”, 3.3 βœ”, 4.0 βœ”, 4.1 βœ”, 4.2 βœ”, 4.3 βœ”, 4.4 βœ”, 4.5 βœ”. she ate and left no crumbs. πŸ‘‘βœ¨


πŸ¦‹ SEE ALSO πŸ¦‹

  • glClearColor
  • glClearDepth
  • glClearStencil
  • glColorMask()
  • glDepthMask()
  • glDrawBuffer()
  • glScissor()
  • glStencilMask()

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/. yes bestie, the URL is exactly that β€” don't tweak it. πŸ’–


Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group. that's the second copyright block, and we are NOT skipping it. periodt. πŸ’…


okay that's the whole page bestie! source: [FIXME: source], date: 08/09/2021, page: GLCLEAR(3G). bye and slay πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from