WebGLVertexArrayObject
接口是WebGL 2 API的一部分,顶点数组对象(VAOs)指向顶点数组数据,并提供不同顶点数据集合的名称。
当使用WebGLVertexArrayObject
对象时,这些方法会很有用:
WebGL2RenderingContext.createVertexArray()
WebGL2RenderingContext.deleteVertexArray()
WebGL2RenderingContext.isVertexArray()
WebGL2RenderingContext.bindVertexArray()
WebGL 1: OES_vertex_array_object
扩展允许你在WebGL 1 上下文环境中使用顶点数组对象。
示例
var vao = gl.createVertexArray();
gl.bindVertexArray(vao);
// ...
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// ...
规范
Specification | Status | Comment |
---|---|---|
WebGL 2.0 WebGLVertexArrayObject |
Editor's Draft | Initial definition. |
浏览器兼容性
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.