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 2015年7月.
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> |
浏览器兼容性
Loading…