WebGLRenderingContext.isBuffer()

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.

WebGLRenderingContext.isBuffer()WebGL API 的方法之一。如果传递的 WebGLBuffer 有效则返回 true,否则返回 false。

句法

GLboolean gl.isBuffer(buffer);

参数

buffer (缓冲区)

需要检查的 WebGLBuffer

返回值

GLboolean 指示 buffer 是否可用。

示例

创建一个缓冲区 (buffer)

js
var canvas = document.getElementById("canvas");
var gl = canvas.getContext("webgl");
var buffer = gl.createBuffer();

gl.isBuffer(buffer);

规范

Specification
WebGL Specification
# 5.14.5

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
isBuffer

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

参见