WebGLRenderingContext.drawArrays()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
WebGL API 中的 WebGLRenderingContext.drawArrays()
方法用于从向量数组中绘制图元。
语法
void gl.drawArrays(mode, first, count);
参数
返回值
无。
异常
- 如果
mode
不是一个可接受值,将会抛出gl.INVALID_ENUM
异常。 - 如果
first
或者count
是负值,会抛出gl.INVALID_VALUE
异常。 - 如果
gl.CURRENT_PROGRAM
为null
,会抛出gl.INVALID_OPERATION
异常。
示例
js
gl.drawArrays(gl.POINTS, 0, 8);
规范
Specification |
---|
WebGL Specification # 5.14.11 |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
drawArrays |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on 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.