WebGLRenderingContext: deleteTexture() method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Note: This feature is available in Web Workers.

Phương thức WebGLRenderingContext.deleteTexture() của WebGL API xóa một đối tượng WebGLTexture đã cho. Phương pháp này không có hiệu lực nếu kết cấu đã bị xóa.

Cú pháp

js
deleteTexture(texture)

Thông số

texture

Một đối tượng WebGLTexture cần xóa.

Giá trị trả về

Không có (undefined).

Ví dụ

Xóa một kết cấu

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

// …

gl.deleteTexture(texture);

Thông số kỹ thuật

Thông số kỹ thuật
WebGL Specification
# 5.14.8

Khả năng tương thích của trình duyệt

Xem thêm