ANGLE_instanced_arrays.drawArraysInstancedANGLE() 方法在 WebGL API renders primitives from array data like the gl.drawArrays() method. In addition, it can execute multiple instances of the range of elements.

注意: 当使用 WebGL2 , this method is available as gl.drawArraysInstanced() 在默认情况下。

句法

void ext.drawArraysInstancedANGLE(mode, first, count, primcount);
					

参数

mode
A GLenum specifying the type primitive to render. Possible values are:
  • gl.POINTS : Draws a single dot.
  • gl.LINE_STRIP : Draws a straight line to the next vertex.
  • gl.LINE_LOOP : Draws a straight line to the next vertex, and connects the last vertex back to the first.
  • gl.LINES : Draws a line between a pair of vertices.
  • gl.TRIANGLE_STRIP
  • gl.TRIANGLE_FAN
  • gl.TRIANGLES : Draws a triangle for a group of three vertices.
第一
GLint specifying the starting index in the array of vector points.
count
GLsizei specifying the number of indices to be rendered.
primcount
GLsizei specifying the number of instances of the range of elements to execute.

返回值

None.

异常

  • mode is not one of the accepted values, a gl.INVALID_ENUM error is thrown.
  • 第一 , count or primcount are negative, a gl.INVALID_VALUE error is thrown.
  • if gl.CURRENT_PROGRAM is null gl.INVALID_OPERATION error is thrown.

范例

var ext = gl.getExtension('ANGLE_instanced_arrays');
ext.drawArraysInstancedANGLE(gl.POINTS, 0, 8, 4);
					

规范

规范 状态 注释
ANGLE_instanced_arrays
The definition of 'ANGLE_instanced_arrays' in that specification.
推荐 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
drawArraysInstancedANGLE Chrome 30 Edge 12 Firefox 33 IE 11 Opera 17 Safari 7 WebView Android 4.4 Chrome Android 30 Firefox Android Yes Opera Android 18 Safari iOS Yes Samsung Internet Android 2.0

图例

完整支持

完整支持

另请参阅

元数据

  • 最后修改: