WebGL2RenderingContext: createVertexArray() 方法
注意:此功能在 Web Workers 中可用。
WebGL2RenderingContext.createVertexArray() 方法是 WebGL 2 API 的一部分,用于创建并初始化一个 WebGLVertexArrayObject 对象。该对象代表一个顶点数组对象(VAO),它指向顶点数组数据,并为不同的顶点数据集提供名称。
语法
js
createVertexArray()
参数
无。
返回值
一个代表顶点数组对象(VAO)的 WebGLVertexArrayObject,它指向顶点数组数据。
示例
js
const vao = gl.createVertexArray();
gl.bindVertexArray(vao);
// …
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// …
规范
| 规范 |
|---|
| WebGL 2.0 规范 # 3.7.17 |
浏览器兼容性
加载中…