WebGLRenderingContext: checkFramebufferStatus() method

Note: This feature is available in Web Workers.

The WebGLRenderingContext.checkFramebufferStatus() method of the WebGL API returns the completeness status of the WebGLFramebuffer object.

Syntax

js
checkFramebufferStatus(target)

Parameters

target

A GLenum specifying the binding point (target). Possible values:

gl.FRAMEBUFFER

Collection buffer data storage of color, alpha, depth and stencil buffers used to render an image.

When using a WebGL 2 context, the following values are available additionally:

gl.DRAW_FRAMEBUFFER

Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations.

gl.READ_FRAMEBUFFER

Used as a source for reading operations.

Return value

A GLenum indicating the completeness status of the framebuffer or 0 if an error occurs. Possible enum return values:

Examples

js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
const framebuffer = gl.createFramebuffer();

// …

gl.checkFramebufferStatus(gl.FRAMEBUFFER);

Specifications

See also