reference

Jump to: navigation, search

Specification

Khronos publishes the WebGL Specification and the WebGL quick reference card.

WebGL Context

A webgl context can be obtained by calling the getContext function on a Canvas Element

Syntax

var gl = canvas.getContext('webgl', attributes) || canvas.getContext('experimental-webgll', attributes)

Arguments

  1. DOMString: 'webgl' or 'experimental-webgl'
  2. Object: WebGLContextAttributes

Return Value

A context object or null.

WebGLContextAttributes

  • boolean alpha: default true
  • boolean depth: default true
  • boolean stencil: default false
  • boolean antialias: default true
  • boolean premultipliedAlpha: default true
  • boolean preserveDrawingBuffer: default false