Firefox Tomorrow

web api instance method

WebGLRenderingContext: createBuffer() method

View on MDN ↗

Available in workers

The WebGLRenderingContext.createBuffer() method of the WebGL API creates and initializes a WebGLBuffer storing data such as vertices or colors.

Syntax

createBuffer()

Parameters

None.

Return value

A WebGLBuffer storing data such as vertices or colors.

Examples

Creating a buffer

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

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also