WebGL2RenderingContext class

The WebGL2RenderingContext interface provides the OpenGL ES 3.0 rendering context for the drawing surface of an HTML <canvas> element. To get an object of this interface, call getContext() on a <canvas> element, supplying "webgl2" as the argument: var canvas = document.getElementById('myCanvas'); var gl = canvas.getContext('webgl2');

Note: WebGL 2 is an extension to WebGL 1. The interface implements all members of the WebGLRenderingContext interface. Some methods of the WebGL 1 context can accept additional values when used in a WebGL 2 context. You will find this info noted on the WebGL 1 reference pages.

The WebGL tutorial has more information, examples, and resources on how to get started with WebGL.

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

WebGL2RenderingContext()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited