web api instance method
WebGLRenderingContext: bindRenderbuffer() method
Available in workers
The WebGLRenderingContext.bindRenderbuffer() method of
the WebGL API binds a given
WebGLRenderbuffer to a target, which must be
gl.RENDERBUFFER.
Syntax
bindRenderbuffer(target, renderbuffer)
Parameters
-
target- : A
GLenumspecifying the binding point (target). Possible values:gl.RENDERBUFFER- : Buffer data storage for single images in a renderable internal format.
- : A
-
renderbuffer- : A
WebGLRenderbufferobject to bind.
- : A
Return value
None (undefined).
Exceptions
A gl.INVALID_ENUM error is thrown if target is not
gl.RENDERBUFFER.
Examples
Binding a renderbuffer
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.
gl.getParameter(gl.RENDERBUFFER_BINDING);
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.