blob: 9f5f0dbbdb6e0597b649baf17d196eb5d66cd94f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
---
title: WebGLRenderingContext.getSupportedExtensions()
slug: Web/API/WebGLRenderingContext/getSupportedExtensions
translation_of: Web/API/WebGLRenderingContext/getSupportedExtensions
---
<div>{{APIRef("WebGL")}}</div>
<p>这个 <strong><font face="Courier New">WebGLRenderingContext.getSupportedExtensions()</font></strong> 方法返回一个所有的支持<a href="/en-US/docs/Web/API/WebGL_API"><u><font color="#0066cc">WebGL</font></u></a> 扩展的列表。</p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox"><var><em>gl</em></var>.getSupportedExtensions();</pre>
<h3 id="返回值">返回值</h3>
<p>一个字符串 {{jsxref("Array")}} 数组,包含所有支持 WebGL 的扩展。</p>
<h2 id="示例代码">示例代码</h2>
<pre class="brush: js">var canvas = document.getElementById("canvas");
gl = canvas.getContext("webgl");
var extensions = gl.getSupportedExtensions();
// Array [ "ANGLE_instanced_arrays", "EXT_blend_minmax", ... ]
</pre>
<p>浏览 {{domxref("WebGLRenderingContext.getExtension()")}} 方法得到一个特定的扩展对象。</p>
<h2 id="WebGL_扩展">WebGL 扩展</h2>
<p>所有WebGL API 扩展都被注册在 <a href="https://www.khronos.org/registry/webgl/extensions/">WebGL Extension Registry</a> 中。当前的扩展是:</p>
<p>{{page("en-US/docs/Web/API/WebGL_API", "Extension_interfaces")}}</p>
<h2 id="规格说明书">规格说明书</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">规格说明书</th>
<th scope="col">状态</th>
<th scope="col">注释</th>
</tr>
<tr>
<td>{{SpecName("WebGL", "#5.14.14", "WebGLRenderingContext.getSupportedExtensions")}}</td>
<td>{{Spec2("WebGL")}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
{{Compat("api.WebGLRenderingContext.getSupportedExtensions")}}
<h2 id="浏览其他相关资源">浏览其他相关资源</h2>
<ul>
<li>{{domxref("WebGLRenderingContext.getExtension()")}}</li>
<li><a href="http://webglreport.com">webglreport.com</a></li>
</ul>
|