GLBINDTEXTURE(3G)
π NAME π
glBindTexture β bind a named texture to a texturing target. This is the GLBINDTEXTURE(3G) page, bestie, and we're gonna make texture binding make sense. π
β¨ C SPECIFICATION β¨
void glBindTexture( GLenum target,
GLuint texture )
πΈ PARAMETERS πΈ
targetβ specifies the target to which the texture is bound. Must be eitherGL_TEXTURE_1D,GL_TEXTURE_2D, orGL_TEXTURE_3D. No other options, bestie. πtextureβ specifies the name of a texture. Yup, that's the whole parameter. π
π¦ DESCRIPTION π¦
okay so glBindTexture lets you create or use a named texture. Calling glBindTexture with target set to GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D and texture set to the name of the newtexture binds the texture name to the target. When a texture is bound to a target, the previous binding for that target is automatically broken. π
Texture names are unsigned integers. The value zero is reserved to represent the default texture for each texture target. Texture names and the corresponding texture contents are local to the shared display-list space (see glXCreateContext) of the current GL rendering context; two rendering contexts share texture names only if they also share display lists. iykyk. π«Ά
You may use glGenTextures to generate a set of new texture names.
When a texture is first bound, it assumes the dimensionality of its target: a texture first bound to GL_TEXTURE_1D becomes one-dimensional, and a texture first bound to GL_TEXTURE_2D becomes two-dimensional, and a texture first bound to GL_TEXTURE_3D becomes a three-dimensional texture. The state of a one-dimensional texture immediately after it is first bound is equivalent to the state of the default GL_TEXTURE_1D at GL initialization, and similarly for two-, and three-dimensional textures. β¨
While a texture is bound, GL operations on the target to which it is bound affect the bound texture, and queries of the target to which it is bound return state from the bound texture. If texture mapping of the dimensionality of the target to which a texture is bound is active, the bound texture is used. In effect, the texture targets become aliases for the textures currently bound to them, and the texture name zero refers to the default textures that were bound to them at initialization. That's the whole vibe. π
A texture binding created with glBindTexture remains active until a different texture is bound to the same target, or until the bound texture is deleted with glDeleteTextures.
Once created, a named texture may be re-bound to the target of the matching dimensionality as often as needed. It is usually much faster to use glBindTexture to bind an existing named texture to one of the texture targets than it is to reload the texture image using glTexImage1D, glTexImage2D, or glTexImage3D. For additional control over performance, use glPrioritizeTextures. π₯
glBindTexture is included in display lists.
π NOTES π
glBindTexture is available only if the GL version is 1.1 or greater. No cap. β
π ERRORS π
GL_INVALID_ENUMis generated iftargetis not one of the allowable values.GL_INVALID_OPERATIONis generated iftexturehas a dimensionality that doesn't match that oftarget.GL_INVALID_OPERATIONis generated ifglBindTextureis executed between the execution ofglBeginand the corresponding execution ofglEnd.
π ASSOCIATED GETS π
glGetwith argumentGL_TEXTURE_BINDING_1DglGetwith argumentGL_TEXTURE_BINDING_2DglGetwith argumentGL_TEXTURE_BINDING_3D
π SEE ALSO π
glAreTexturesResident(3G)glDeleteTextures(3G)glGenTextures(3G)glGet(3G)glGetTexParameter(3G)glIsTexture(3G)glPrioritizeTextures(3G)glTexImage1D(3G)glTexImage2D(3G)glTexParameter(3G)
and that's the GLBINDTEXTURE(3G) page, 3G manual section β source/version tag as printed is GLBINDTEXTURE(3G), and the footer has no date, so bestie, no fake date from me. periodt. π
π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: Mesa-libGL-devel 24.1.7-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms