files/en-us/web/api/webglrenderingcontext/getrenderbufferparameter/index.md
{{APIRef("WebGL")}}{{AvailableInWorkers}}
The WebGLRenderingContext.getRenderbufferParameter()
method of the WebGL API returns information
about the renderbuffer.
getRenderbufferParameter(target, pname)
target
gl.RENDERBUFFER
pname
: A {{domxref("WebGL_API/Types", "GLenum")}} specifying the information to query. Possible values:
gl.RENDERBUFFER_WIDTH
gl.RENDERBUFFER_HEIGHT
gl.RENDERBUFFER_INTERNAL_FORMAT
gl.RGBA4. Possible return values:
gl.RGBA4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits.gl.RGB565: 5 red bits, 6 green bits, 5 blue bits.gl.RGB5_A1: 5 red bits, 5 green bits, 5 blue bits, 1 alpha bit.gl.DEPTH_COMPONENT16: 16 depth bits.gl.STENCIL_INDEX8: 8 stencil bits.gl.RENDERBUFFER_GREEN_SIZE
gl.RENDERBUFFER_BLUE_SIZE
gl.RENDERBUFFER_RED_SIZE
gl.RENDERBUFFER_ALPHA_SIZE
gl.RENDERBUFFER_DEPTH_SIZE
gl.RENDERBUFFER_STENCIL_SIZE
When using a {{domxref("WebGL2RenderingContext", "WebGL 2 context", "", 1)}}, the following value is available additionally:
gl.RENDERBUFFER_SAMPLES
Depends on the requested information (as specified with pname). Either a
{{domxref("WebGL_API/Types", "GLint")}} or a {{domxref("WebGL_API/Types", "GLenum")}}.
gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH);
{{Specifications}}
{{Compat}}