WebGLRenderingContext: bindRenderbuffer() method

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.

Note: This feature is available in Web Workers.

The WebGLRenderingContext.bindRenderbuffer() method of the WebGL API binds a given WebGLRenderbuffer to a target, which must be gl.RENDERBUFFER.

Syntax

js
bindRenderbuffer(target, renderbuffer)

Parameters

target

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

gl.RENDERBUFFER

Buffer data storage for single images in a renderable internal format.

renderbuffer

A WebGLRenderbuffer object to bind.

Return value

None (undefined).

Exceptions

A gl.INVALID_ENUM error is thrown if target is not gl.RENDERBUFFER.

Examples

Binding a renderbuffer

js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
const renderbuffer = gl.createRenderbuffer();

gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);

Getting current bindings

To check the current renderbuffer binding, query the RENDERBUFFER_BINDING constant.

js
gl.getParameter(gl.RENDERBUFFER_BINDING);

Specifications

Specification
WebGL Specification
# 5.14.7

Browser compatibility

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
bindRenderbuffer

Legend

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

Full support
Full support

See also