GLCLEARTEXIMAGE(3G)

🌸 glClearTexImage β€” filling a texture image with one constant value, bestie 🌸

okay so this is the GLCLEARTEXIMAGE(3G) page from the 3G manual β€” yes, the header has a [FIXME: manual] placeholder, we love a work in progress β€” and it's literally about clearing a whole texture image to a constant value. no cap, it's giving "one value to rule the whole image" energy. ✨


πŸŽ€ NAME πŸŽ€

glClearTexImage β€” fills all a texture image with a constant value πŸ’…

🧚 C SPECIFICATION 🧚

void glClearTexImage(GLuint texture, GLint level, GLenum format,
                     GLenum type, const void * data);

πŸ“ PARAMETERS πŸ“

  • texture β€” the name of an existing texture object containing the image to be cleared, bestie.
  • level β€” the level of texture containing the region to be cleared.
  • format β€” the format of the data whose address in memory is given by data.
  • type β€” the type of the data whose address in memory is given by data.
  • data β€” the address in memory of the data to be used to clear the specified region.

🌈 DESCRIPTION 🌈

glClearTexImage fills, like, all an image contained in a texture with an application supplied value. texture must be the name of an existing texture. Also, texture may not be the name of a buffer texture, and its internal format may not be compressed. 🫢

format and type specify the format and type of the source data and are interpreted as they are for glTexImage3D(). Textures with a base internal format of GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, or GL_DEPTH_STENCIL require depth component, stencil, or depth-stencil component data respectively. Textures with other base internal formats require RGBA formats. Textures with integer internal formats require integer data. πŸ’–

data is a pointer to an array of between one and four components of texel data that will be used as the source for the constant fill value. The elements of data are converted by the GL into the internal format of the texture image (that was specified when the level was defined by any of the glTexImage*, glTexStorage* or glCopyTexImage* commands), and then used to fill the specified range of the destination texture level. If data is NULL, then the pointer is ignored and the sub-range of the texture image is filled with zeros. If texture is a multisample texture, all the samples in a texel are cleared to the value specified by data. 🌟

⭐ NOTES ⭐

glClearTexImage is available only if the GL version is 4.4 or greater. no cap. πŸ”₯

πŸ’€ ERRORS πŸ’€

  • GL_INVALID_OPERATION is generated if texture is zero or not the name of an existing texture object. 😭
  • GL_INVALID_OPERATION is generated if texture is a buffer texture.
  • GL_INVALID_OPERATION is generated if texture has a compressed internal format.
  • GL_INVALID_OPERATION is generated if the base internal format is GL_DEPTH_COMPONENT and format is not GL_DEPTH_COMPONENT.
  • GL_INVALID_OPERATION is generated if the base internal format is GL_DEPTH_STENCIL and format is not GL_DEPTH_STENCIL.
  • GL_INVALID_OPERATION is generated if the base internal format is GL_STENCIL_INDEX and format is not GL_STENCIL_INDEX.
  • GL_INVALID_OPERATION is generated if the base internal format is GL_RGBA and format is GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, or GL_DEPTH_STENCIL.
  • GL_INVALID_OPERATION is generated if the internal format is integer and format does not specify integer data.
  • GL_INVALID_OPERATION is generated if the internal format is not integer and format specifies integer data.
  • GL_INVALID_OPERATION is generated if the image array identified by level has not previously been defined by a call to glTexImage* or glTexStorage*.

πŸ” ASSOCIATED GETS πŸ”

  • glGetTexImage()
  • glGetInternalformat()

πŸ‘‘ VERSION SUPPORT πŸ‘‘

the vibe check: the Function / Feature Name is glClearTexImage, and the OpenGL Version columns go like this:

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

πŸ¦‹ SEE ALSO πŸ¦‹

  • glClearTexSubImage()
  • glTexStorage1D()
  • glTexStorage2D()
  • glTexStorage3D()
  • glTexImage1D()
  • glTexImage2D()
  • glTexImage3D()

Copyright Β© 2013-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

Copyright Β© 2013-2014 Khronos Group


ok that's the whole page bestie 🫢 this came from [FIXME: source], dated 08/09/2021, and the manual name is GLCLEARTEXIMAGE(3G). go clear some textures and slay βœ¨πŸ’…
πŸ“¦ where this page comes from