diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/webglrenderingcontext/bindattriblocation | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/webglrenderingcontext/bindattriblocation')
-rw-r--r-- | files/zh-cn/web/api/webglrenderingcontext/bindattriblocation/index.html | 70 |
1 files changed, 70 insertions, 0 deletions
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 +--- +<p>{{APIRef("WebGL")}}</p> + +<p>WebGL API的WebGLRenderingContext.bindAttribLocation()方法将通用顶点索引绑定到属性变量。</p> + +<h2 id="语法">语法</h2> + +<pre>void <var>gl</var>.bindAttribLocation(<var>program</var>, <var>index</var>, <var>name</var>); +</pre> + +<h3 id="参数">参数</h3> + +<dl> + <dt><code>program</code></dt> + <dd>要绑定的{{domxref("WebGLProgram")}} 对象。</dd> + <dt>index</dt> + <dd>{{domxref("GLuint")}} 指定要绑定的通用顶点的索引。</dd> + <dt>name</dt> + <dd>{{domxref("DOMString")}}指定要绑定到通用顶点索引的变量的名称。 该名称不能以“webgl_”或“_webgl_”开头,因为这些名称将保留供WebGL使用。</dd> +</dl> + +<h3 id="返回值">返回值</h3> + +<p>None.</p> + +<h2 id="示例">示例</h2> + +<pre>gl.bindAttribLocation(program, colorLocation, 'vColor'); +</pre> + +<h2 id="规范">规范</h2> + +<table> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('WebGL', "#5.14.9", "bindAttribLocation")}}</td> + <td>{{Spec2('WebGL')}}</td> + <td>Initial definition.</td> + </tr> + <tr> + <td>{{SpecName('OpenGL ES 2.0', "glBindAttribLocation.xml", "glBindAttribLocation")}}</td> + <td>{{Spec2('OpenGL ES 2.0')}}</td> + <td>Man page of the (similar) OpenGL API.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容">浏览器兼容</h2> + +<p>{{Compat("api/WebGLRenderingContext", "WebGLRenderingContext.bindAttribLocation")}}</p> + +<h2 id="另见">另见</h2> + +<ul> + <li>{{domxref("WebGLRenderingContext.getActiveAttrib()")}}</li> + <li>{{domxref("WebGLRenderingContext.getAttribLocation()")}}</li> + <li>{{domxref("WebGLRenderingContext.getVertexAttrib()")}}</li> +</ul> |