WebGLRenderingContext.createBuffer()
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.createBuffer()
方法可创建并初始化一个用于储存顶点数据或着色数据的WebGLBuffer
对象
语法
WebGLBuffer gl.createBuffer();
参数
无。
返回值
一个用于储存顶点数据或着色数据的WebGLBuffer
对象
范例
创建一个缓冲区
js
var canvas = document.getElementById("canvas");
var gl = canvas.getContext("webgl");
var buffer = gl.createBuffer();
规范
Specification |
---|
WebGL Specification # 5.14.5 |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
createBuffer |
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.