MDN self-hosted library · e01.org

WebGLRenderingContext: deleteTexture() method

WebGL

WebGL

The WebGLRenderingContext.deleteTexture() method of the WebGL API deletes a given WebGLTexture object. This method has no effect if the texture has already been deleted.

Syntax

deleteTexture(texture)

Parameters

  • texture
  • : A WebGLTexture object to delete. Passing null does nothing.

Return value

None (undefined).

Examples

Deleting a texture

const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
const texture = gl.createTexture();

// …

gl.deleteTexture(texture);

Specifications

Browser compatibility

See also

  • WebGLRenderingContext.bindTexture()
  • WebGLRenderingContext.createTexture()
  • WebGLRenderingContext.isTexture()
  • WebGLRenderingContext.texImage2D()