GPUContext

Creates a GPUCanvasContext and augments it with extra methods and properties. All methods and properties of GPUCanvasContext can be directly accessed from this class.

Constructor

new L3D.GPUContext(options)

Parameters
options Object

supported options:

Properties
canvas Canvas

The canvas to use.

width Number

The width of the canvas to be created.

height Number

The height of the canvas to be created.

container Element | String

The containing element for the created canvas.

version Number

The version of WebGL to use, either 1 or 2. 0 or undefined will use the greatest available version.

Properties

resourceManager GPUResourceManager

Manages a cache of GPU objects.

Methods

destroy()

Destroy this WebGPU context and removes the Canvas from the DOM.