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

{{APIRef("WebGL")}}

+ +

WebGL API的WebGLRenderingContext.bindAttribLocation()方法将通用顶点索引绑定到属性变量。

+ +

语法

+ +
void gl.bindAttribLocation(program, index, name);
+
+ +

参数

+ +
+
program
+
要绑定的{{domxref("WebGLProgram")}} 对象。
+
index
+
{{domxref("GLuint")}} 指定要绑定的通用顶点的索引。
+
name
+
{{domxref("DOMString")}}指定要绑定到通用顶点索引的变量的名称。 该名称不能以“webgl_”或“_webgl_”开头,因为这些名称将保留供WebGL使用。
+
+ +

返回值

+ +

None.

+ +

示例

+ +
gl.bindAttribLocation(program, colorLocation, 'vColor');
+
+ +

规范

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

浏览器兼容

+ +

{{Compat("api/WebGLRenderingContext", "WebGLRenderingContext.bindAttribLocation")}}

+ +

另见

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