WebGLRenderingContext: isProgram() 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.isProgram() của WebGL API trả về true nếu WebGLProgram được truyền là hợp lệ, nếu không thì false.
Cú pháp
js
isProgram(program)
Thông số
program-
A
WebGLProgramđể kiểm tra.
Giá trị trả về
Một GLboolean cho biết chương trình có hợp lệ hay không.
Ví dụ
>Kiểm tra một chương trình
js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
const program = gl.createProgram();
// …
gl.isProgram(program);
Thông số kỹ thuật
| Specification |
|---|
| WebGL Specification> # 5.14.9> |