logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

glBindTextures - bind one or more named textures to a sequence of consecutive texture units

Associated Gets

glGet() with argument GL_TEXTURE_BINDING_1D, GL_TEXTURE_BINDING_2D, GL_TEXTURE_BINDING_3D,
       GL_TEXTURE_BINDING_1D_ARRAY, GL_TEXTURE_BINDING_2D_ARRAY, GL_TEXTURE_BINDING_RECTANGLE,
       GL_TEXTURE_BINDING_BUFFER, GL_TEXTURE_BINDING_CUBE_MAP, GL_TEXTURE_BINDING_CUBE_MAP,
       GL_TEXTURE_BINDING_CUBE_MAP_ARRAY, GL_TEXTURE_BINDING_2D_MULTISAMPLE, or
       GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY.

C Specification

voidglBindTextures(GLuintfirst,GLsizeicount,constGLuint*textures);

Description

glBindTextures binds an array of existing texture objects to a specified number of consecutive texture
       units.  count specifies the number of texture objects whose names are stored in the array textures. That
       number of texture names are read from the array and bound to the count consecutive texture units starting
       from first. The target, or type of texture is deduced from the texture object and each texture is bound
       to the corresponding target of the texture unit. If the name zero appears in the textures array, any
       existing binding to any target of the texture unit is reset and the default texture for that target is
       bound in its place. Any non-zero entry in textures must be the name of an existing texture object. If
       textures is NULL then it is as if an appropriately sized array containing only zeros had been specified.

       With the exception that the active texture selector maintains its current value, glBindTextures is
       equivalent to the following pseudo code:

               for (i = 0; i < count; i++) {
                   GLuint texture;
                   if (textures == NULL) {
                       texture = 0;
                   } else {
                       texture = textures[i];
                   }
                   glActiveTexture(GL_TEXTURE0 + first + i);
                   if (texture != 0) {
                       GLenum target = /* target of textures[i] */;
                       glBindTexture(target, textures[i]);
                   } else {
                       for (target in all supported targets) {
                           glBindTexture(target, 0);
                       }
                   }
               }

       Each entry in textures will be checked individually and if found to be invalid, the state for that
       texture unit will not be changed and an error will be generated. However, the state for other texture
       units referenced by the command will still be updated.

Errors

GL_INVALID_OPERATION is generated if first + count is greater than the number of texture image units
       supported by the implementation.

       GL_INVALID_OPERATION is generated if any value in textures is not zero or the name of an existing texture
       object.

Name

       glBindTextures - bind one or more named textures to a sequence of consecutive texture units

Notes

glBindTextures is available only if the GL version is 4.4 or higher.

       Note that because glBindTextures cannot create new textures (even if a name passed has been previously
       generated by call to glGenTextures()), names pased to glBindTextures must have been bound at least once
       previously via a call to glBindTexture().

Parameters

first
           Specifies the first texture unit to which a texture is to be bound.

       count
           Specifies the number of textures to bind.

       textures
           Specifies the address of an array of names of existing texture objects.

See Also

glBindTexture(), glDeleteTextures(), glGenTextures(), glGet(), glGetTexParameter(), glIsTexture(),
       glTexImage1D(), glTexImage2D(), glTexImage2DMultisample(), glTexImage3D(), glTexImage3DMultisample(),
       glTexBuffer(), glTexParameter()

Version Support

       ┌────────────────┬───────────────────────────────────────────────────────────────────────┐
       │                │                OpenGLVersion                                         │
       ├────────────────┼─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┤
       │ Function2.02.13.03.13.23.34.04.14.24.34.44.5 │
       │ /              │     │     │     │     │     │     │     │     │     │     │     │     │
       │ Feature        │     │     │     │     │     │     │     │     │     │     │     │     │
       │ Name           │     │     │     │     │     │     │     │     │     │     │     │     │
       ├────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
       │ glBindTextures │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  ✔  │  ✔  │
       └────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘

See Also