OES_vertex_array_object

拓展OES_vertex_array_objectWebGL API的一部分,它提供了顶点数组对象 (VAOs) 可以用来封装顶点数组的状态。These objects keep pointers to vertex data and provide names for different sets of vertex data.

WebGL extensions are available using the WebGLRenderingContext.getExtension() method. 更多详细信息,参见 Using Extensions in the WebGL tutorial.

备注: Availability: 此拓展只在WebGL1中有效。在WebGL2当中,这些功能可以被直接使用,且去掉了前缀 "OES"。

常量

这个拓展提供了一个新的常量,它可以在gl.getParameter() 当中作为一个参数传递:

ext.VERTEX_ARRAY_BINDING_OES

当作为gl.getParameter()中的pname参数传递时,返回一个WebGLVertexArrayObject 对象。

函数

这个拓展提供了四个新的函数。

ext.createVertexArrayOES() (en-US)

创建一个新的 WebGLVertexArrayObject

ext.deleteVertexArrayOES() (en-US)

删除一个给定的 WebGLVertexArrayObject

ext.isVertexArrayOES() (en-US)

如果参数是一个 WebGLVertexArrayObject则返回 true

ext.bindVertexArrayOES() (en-US)

绑定一个给定的WebGLVertexArrayObject到缓冲区。

Examples

js
var oes_vao_ext = gl.getExtension("OES_vertex_array_object");
var vao = oes_vao_ext.createVertexArrayOES();
oes_vao_ext.bindVertexArrayOES(vao);

// ...
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// ...

Specifications

Specification
WebGL OES_vertex_array_object Khronos Ratified Extension Specification

Browser compatibility

BCD tables only load in the browser

参见