/
index.md
41 lines (27 loc) · 1.02 KB
/
index.md
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
---
title: WebGLVertexArrayObject
slug: Web/API/WebGLVertexArrayObject
---
{{APIRef("WebGL")}}
**`WebGLVertexArrayObject`**接口是[WebGL 2 API](/zh-CN/docs/Web/API/WebGL_API)的一部分,顶点数组对象 (VAOs) 指向顶点数组数据,并提供不同顶点数据集合的名称。
当使用`WebGLVertexArrayObject`对象时,这些方法会很有用:
- {{domxref("WebGL2RenderingContext.createVertexArray()")}}
- {{domxref("WebGL2RenderingContext.deleteVertexArray()")}}
- {{domxref("WebGL2RenderingContext.isVertexArray()")}}
- {{domxref("WebGL2RenderingContext.bindVertexArray()")}}
> **备注:** **WebGL 1:** {{domxref("OES_vertex_array_object")}} 扩展允许你在 WebGL 1 上下文环境中使用顶点数组对象。
## 示例
```js
var vao = gl.createVertexArray();
gl.bindVertexArray(vao);
// ...
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// ...
```
## 规范
{{Specifications}}
## 浏览器兼容性
{{Compat}}
## 相关链接
- {{domxref("OES_vertex_array_object")}}