GLCOMPRESSEDTEXSUBIM(3G)
πΈ NAME πΈ
okay so bestie, welcome to the [FIXME: manual] page for GLCOMPRESSEDTEXSUBIM(3G) β this is the whole vibe. glCompressedTexSubImage2D and glCompressedTextureSubImage2D specify a two-dimensional texture subimage in a compressed format. periodt. π
β¨ C SPECIFICATION β¨
here's the exact signature, no cap:
void glCompressedTexSubImage2D(GLenum target, GLint level,
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize,
const GLvoid * data);
void glCompressedTextureSubImage2D(GLuint texture, GLint level,
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize,
const void *data);
π PARAMETERS π
targetβ forglCompressedTexSubImage2D, this is the target the texture is bound to. it must beGL_TEXTURE_1D_ARRAY,GL_TEXTURE_2D,GL_TEXTURE_CUBE_MAP_POSITIVE_X,GL_TEXTURE_CUBE_MAP_NEGATIVE_X,GL_TEXTURE_CUBE_MAP_POSITIVE_Y,GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,GL_TEXTURE_CUBE_MAP_POSITIVE_Z, orGL_TEXTURE_CUBE_MAP_NEGATIVE_Z. yes, all of those, bestie β¨textureβ the texture object name forglCompressedTextureSubImage2D.levelβ the level-of-detail number. level0is the base image level. level n is the *n*th mipmap reduction image.xoffsetβ a texel offset in the x direction within the texture array.yoffsetβ a texel offset in the y direction within the texture array.widthβ the width of the texture subimage.heightβ the height of the texture subimage.formatβ the format of the compressed image data stored at addressdata.imageSizeβ the number of unsigned bytes of image data starting at the address specified bydata.dataβ a pointer to the compressed image data in memory.
π¦ DESCRIPTION π¦
texturing allows elements of an image array to be read by shaders. iconic behavior, honestly.
glCompressedTexSubImage2D and glCompressedTextureSubImage2D redefine a contiguous subregion of an existing two-dimensional texture image. the texels referenced by data replace the portion of the existing texture array with x indices xoffset and xoffset + width - 1, and the y indices yoffset and yoffset + height - 1, inclusive. this region may not include any texels outside the range of the texture array as it was originally specified. also! it is not an error to specify a subtexture with width of 0, but such a specification has no effect. so like, valid but pointless. we've all been there π
internalformat must be a known compressed image format (such as GL_RGTC) or an extension-specified compressed-texture format. the format of the compressed texture image is selected by the GL implementation that compressed it (see glTexImage2D()) and should be queried at the time the texture was compressed with glGetTexLevelParameter().
if a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER target (see glBindBuffer()) while a texture image is specified, data is treated as a byte offset into the buffer object's data store. okay? okay. π«Ά
π ERRORS π
GL_INVALID_ENUMis generated ifinternalformatis one of the generic compressed internal formats:GL_COMPRESSED_RED,GL_COMPRESSED_RG,GL_COMPRESSED_RGB,GL_COMPRESSED_RGBA,GL_COMPRESSED_SRGB, orGL_COMPRESSED_SRGB_ALPHA.GL_INVALID_ENUMis generated byglCompressedTexSubImage2DiftargetisGL_TEXTURE_RECTANGLEorGL_PROXY_TEXTURE_RECTANGLE.GL_INVALID_VALUEis generated ifimageSizeis not consistent with the format, dimensions, and contents of the specified compressed image data.GL_INVALID_OPERATIONis generated if parameter combinations are not supported by the specific compressed internal format as specified in the specific texture compression extension.GL_INVALID_OPERATIONis generated if a non-zero buffer object name is bound to theGL_PIXEL_UNPACK_BUFFERtarget and the buffer object's data store is currently mapped.GL_INVALID_OPERATIONis generated if a non-zero buffer object name is bound to theGL_PIXEL_UNPACK_BUFFERtarget and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size.GL_INVALID_OPERATIONis generated byglCompressedTextureSubImage2Diftextureis not the name of an existing texture object.GL_INVALID_OPERATIONis generated byglCompressedTextureSubImage2Dif the effective target isGL_TEXTURE_RECTANGLE.
β οΈ warning bestie: undefined results, including abnormal program termination, are generated if data is not encoded in a manner consistent with the extension specification defining the internal compression format. so pls encode responsibly ππ
π ASSOCIATED GETS π
glGetCompressedTexImage()glGet()with argumentGL_TEXTURE_COMPRESSEDglGet()with argumentGL_PIXEL_UNPACK_BUFFER_BINDINGglGetTexLevelParameter()with argumentsGL_TEXTURE_INTERNAL_FORMATandGL_TEXTURE_COMPRESSED_IMAGE_SIZE
π VERSION SUPPORT π
the original table tracks Function / Feature Name across OpenGL Version 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5. here's the vibe:
glCompressedTexSubImage2Dβ β in2.0,2.1,3.0,3.1,3.2,3.3,4.0,4.1,4.2,4.3,4.4, and4.5. slay, all of them π₯glCompressedTextureSubImage2Dβ - in2.0,2.1,3.0,3.1,3.2,3.3,4.0,4.1,4.2,4.3, and4.4; β in4.5only. late bloomer icon behavior π
π SEE ALSO π
glActiveTexture(), glCompressedTexImage1D(), glCompressedTexImage2D(), glCompressedTexImage3D(), glCompressedTexSubImage1D(), glCompressedTexSubImage3D(), glCopyTexImage1D(), glCopyTexImage2D(), glCopyTexSubImage1D(), glCopyTexSubImage2D(), glCopyTexSubImage3D(), glPixelStore(), glTexImage2D(), glTexImage3D(), glTexSubImage1D(), glTexSubImage2D(), glTexSubImage3D(), glTexParameter()
π COPYRIGHT π
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 π
Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group
okay bye bestie β this page is from [FIXME: source], dated 08/09/2021, and it's GLCOMPRESSEDTEXSUBIM(3G) forever π
β¨
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms