From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/webglrenderingcontext/isprogram/index.html | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 files/zh-cn/web/api/webglrenderingcontext/isprogram/index.html (limited to 'files/zh-cn/web/api/webglrenderingcontext/isprogram') diff --git a/files/zh-cn/web/api/webglrenderingcontext/isprogram/index.html b/files/zh-cn/web/api/webglrenderingcontext/isprogram/index.html new file mode 100644 index 0000000000..0c272f6188 --- /dev/null +++ b/files/zh-cn/web/api/webglrenderingcontext/isprogram/index.html @@ -0,0 +1,77 @@ +--- +title: WebGLRenderingContext.isProgram() +slug: Web/API/WebGLRenderingContext/isProgram +translation_of: Web/API/WebGLRenderingContext/isProgram +--- +

{{APIRef("WebGL")}}

+ +

 WebGL API中的WebGLRenderingContext.isProgram() 函数 将会在{{domxref("WebGLProgram")}}是一个合法的着色器程序(program)时返回 true , 而在其他情况返回false

+ +

语法

+ +
GLboolean gl.isProgram(program);
+
+ +

参数

+ +
+
program
+
一个要检查的 {{domxref("WebGLProgram")}}对象 .
+
+ +

返回值

+ +

一个表示program是否有效的 {{domxref("GLboolean")}} 值.

+ +

示例

+ +

检查一个program是否有效

+ +
var canvas = document.getElementById('canvas');
+var gl = canvas.getContext('webgl');
+var program = gl.createProgram();
+
+// ...
+
+gl.isProgram(program);
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('WebGL', "#5.14.9", "isProgram")}}{{Spec2('WebGL')}}Initial definition.
{{SpecName('OpenGL ES 2.0', "glIsProgram.xml", "glIsProgram")}}{{Spec2('OpenGL ES 2.0')}}Man page of the OpenGL API.
+ +

浏览器兼容性

+ + + +

{{Compat("api.WebGLRenderingContext.isProgram")}}

+ +

另请参见

+ + -- cgit v1.2.3-54-g00ecf