MDN self-hosted library · e01.org

WebGLRenderingContext: isBuffer() method

WebGL

WebGL

The WebGLRenderingContext.isBuffer() method of the WebGL API returns true if the passed WebGLBuffer is valid and false otherwise.

Syntax

isBuffer(buffer)

Parameters

  • buffer
  • : A WebGLBuffer to check. Passing null returns false.

Return value

A GLboolean indicating whether or not the buffer is valid.

Examples

Creating a buffer

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

gl.isBuffer(buffer);

Specifications

Browser compatibility

See also

  • WebGLRenderingContext.bindBuffer()
  • WebGLRenderingContext.createBuffer()
  • WebGLRenderingContext.deleteBuffer()
  • Other buffers: WebGLFramebuffer, WebGLRenderbuffer