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()

创建一个新的 WebGLVertexArrayObject

ext.deleteVertexArrayOES()

删除一个给定的 WebGLVertexArrayObject

ext.isVertexArrayOES()

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

ext.bindVertexArrayOES()

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

Examples

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 Status Comment
OES_vertex_array_object
OES_vertex_array_object
Recommendation Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
OES_vertex_array_objectChrome Full support YesEdge Full support 17Firefox Full support 25IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android ? Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
bindVertexArrayOESChrome Full support YesEdge Full support 17Firefox Full support 25IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android ? Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
createVertexArrayOESChrome Full support YesEdge Full support 17Firefox Full support 25IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android ? Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
deleteVertexArrayOESChrome Full support YesEdge Full support 17Firefox Full support 25IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android ? Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
isVertexArrayOESChrome Full support YesEdge Full support 17Firefox Full support 25IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android ? Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

参见