WebGLRenderingContext: isTexture() 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.isTexture() của WebGL API trả về true nếu WebGLTexture được truyền là hợp lệ và false nếu ngược lại.
Cú pháp
js
isTexture(texture)
Thông số
texture-
A
WebGLTextuređể kiểm tra.
Giá trị trả về
GLboolean cho biết kết cấu có hợp lệ hay không.
Ví dụ
>Kiểm tra kết cấu
js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
const texture = gl.createTexture();
gl.isTexture(texture);
Thông số kỹ thuật
| Specification |
|---|
| WebGL Specification> # 5.14.8> |