glDeleteTextures

The glDeleteTextures function deletes named textures.

void glDeleteTextures(
  GLsizei n,  const GLuint *textures);

Parameters

  • n
    The number of textures to be deleted.
  • textures
    An array of textures to be deleted.

Remarks

The glDeleteTextures function deletes n textures named by the elements of the array textures. After a texture is deleted, it has no contents or dimensionality, and its name is free for reuse (for example, by glGenTextures). The glDeleteTextures function ignores zeros and names that do not correspond to existing textures.

If a texture that is currently bound is deleted, the binding reverts to zero (the default texture).

You cannot include calls to glDeleteTextures in display lists.

Note  The glDeleteTextures function is only available in OpenGL version 1.1 or later.

The following function retrieves information related to glDeleteTextures:

glIsTexture

Error Codes

The following are the error codes generated and their conditions.

Error code Condition
GL_INVALID_VALUE n was a negative value.
GL_INVALID_OPERATION glDeleteTextures was called between a call to glBegin and the corresponding call to glEnd.

Requirements

**  Windows NT/2000:** Requires Windows NT 4.0 or later.
**  Windows 95/98:** Requires Windows 95 or later. Available as a redistributable for Windows 95.
**  Header:** Declared in Gl.h.
**  Library:** Use Opengl32.lib.

See Also

glAreTexturesResident, glBegin, glBindTexture, glEnd, glGenTextures, glGet, glGetTexParameter, glIsTexture, glPrioritizeTextures, glTexGen, glTexImage1D, glTexImage2D, glTexParameter