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/webgl2renderingcontext/beginquery/index.html | |
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/webgl2renderingcontext/beginquery/index.html')
-rw-r--r-- | files/zh-cn/web/api/webgl2renderingcontext/beginquery/index.html | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/webgl2renderingcontext/beginquery/index.html b/files/zh-cn/web/api/webgl2renderingcontext/beginquery/index.html new file mode 100644 index 0000000000..ef9c00baea --- /dev/null +++ b/files/zh-cn/web/api/webgl2renderingcontext/beginquery/index.html @@ -0,0 +1,74 @@ +--- +title: WebGL2RenderingContext.beginQuery() +slug: Web/API/WebGL2RenderingContext/beginQuery +translation_of: Web/API/WebGL2RenderingContext/beginQuery +--- +<div>{{APIRef("WebGL")}} {{SeeCompatTable}}</div> + +<p><a href="/en-US/docs/Web/API/WebGL_API">WebGL 2 API</a> 的<strong><code>WebGL2RenderingContext.beginQuery()</code></strong> 方法启动一个异步查询,<code>target</code> 参数表明是哪种类型的查询。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox">void <var>gl</var>.beginQuery(<var>target</var>, <var>query</var>); +</pre> + +<h3 id="参数">参数</h3> + +<dl> + <dt>target</dt> + <dd> {{domxref("GLenum")}} 指定查询个的target, 可能的值有: + <ul> + <li><code>gl.ANY_SAMPLES_PASSED</code>: Specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the depth test and if so, how many samples pass).</li> + <li><code>gl.ANY_SAMPLES_PASSED_CONSERVATIVE</code>: 和以上一样, 但是是一个不精确和更快的版本。</li> + <li><code>gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</code>: Number of primitives that are written to transform feedback buffers.</li> + </ul> + </dd> + <dt><code>query</code></dt> + <dd>一个{{domxref("WebGLQuery")}} 对象用于查询。</dd> +</dl> + +<h3 id="返回值">返回值</h3> + +<p>None.</p> + +<h2 id="例子">例子</h2> + +<pre class="brush: js">var query = gl.createQuery(); +gl.beginQuery(gl.ANY_SAMPLES_PASSED, query); + +// ... +</pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('WebGL2', "#3.7.12", "beginQuery")}}</td> + <td>{{Spec2('WebGL2')}}</td> + <td>Initial definition.</td> + </tr> + <tr> + <td>{{SpecName('OpenGL ES 3.0', "glBeginQuery.xhtml", "glBeginQuery")}}</td> + <td>{{Spec2('OpenGL ES 3.0')}}</td> + <td>Man page of the (similar) OpenGL API.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容">浏览器兼容</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("api.WebGL2RenderingContext.beginQuery")}}</p> + +<h2 id="参考">参考</h2> + +<ul> + <li>{{domxref("WebGLQuery")}}</li> +</ul> |