-> Click here to learn how to get live help <-
NAMEglBindTexture - bind a named texture to a texturing target
C SPECIFICATIONvoid f3glBindTexturefP( GLenum fItargetfP,
f2targetfP Specifies the target to which the texture is bound. Must be either %f3GL_TEXTURE_1DfP, %f3GL_TEXTURE_2DfP, or %f3GL_TEXTURE_3DfP.
DESCRIPTION%f3glBindTexturefP lets you create or use a named texture. Calling %f3glBindTexturefP with
f2targetfP set to %f3GL_TEXTURE_1DfP, %f3GL_TEXTURE_2DfP, %f3GL_TEXTURE_3DfP and f2texturefP 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 %f3glXCreateContextfP) of the current GL rendering context; two rendering contexts share texture names only if they also share display lists. You may use %f3glGenTexturesfP 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 %f3GL_TEXTURE_1DfP becomes one-dimensional, and a texture first bound to %f3GL_TEXTURE_2DfP becomes two-dimensional, and a texture first bound to %f3GL_TEXTURE_3DfP 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 %f3GL_TEXTURE_1DfP 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. A texture binding created with %f3glBindTexturefP remains active until a different texture is bound to the same target, or until the bound texture is deleted with %f3glDeleteTexturesfP. 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 %f3glBindTexturefP to bind an existing named texture to one of the texture targets than it is to reload the texture image using %f3glTexImage1DfP, %f3glTexImage2DfP, or %f3glTexImage3DfP. For additional control over performance, use %f3glPrioritizeTexturesfP. %f3glBindTexturefP is included in display lists.
NOTES%f3glBindTexturefP is available only if the GL version is 1.1 or greater.
ERRORS%f3GL_INVALID_ENUMfP is generated if f2targetfP is not one of the allowable values. %f3GL_INVALID_OPERATIONfP is generated if f2texturefP has a dimensionality that doesn't match that of f2targetfP. %f3GL_INVALID_OPERATIONfP is generated if %f3glBindTexturefP is executed between the execution of %f3glBeginfP and the corresponding execution of %f3glEndfP.
ASSOCIATED GETS%f3glGetfP with argument %f3GL_TEXTURE_BINDING_1DfP
%f3glGetfP with argument %f3GL_TEXTURE_BINDING_2DfP
%f3glGetfP with argument %f3GL_TEXTURE_BINDING_3DfP
SEE ALSO%f3glAreTexturesResident(3G)fP, %f3glDeleteTextures(3G)fP, %f3glGenTextures(3G)fP, %f3glGet(3G)fP,
%f3glGetTexParameter(3G)fP, %f3glIsTexture(3G)fP, %f3glPrioritizeTextures(3G)fP, %f3glTexImage1D(3G)fP, %f3glTexImage2D(3G)fP, %f3glTexParameter(3G)fP