Skip to content

Interface: WebGLContextConstructor<T> ​

Defined in: types/desktop-engine.d.ts:3324

The global WebGLRenderingContext / WebGL2RenderingContext (also on DesktopEngine), set up by the Canvas module polyfill. Stand-in classes for instanceof and gl.constructor.name (the contexts are native objects); they hold no constants. instanceof compares Object.prototype.toString tags, so a WebGL 2 context is not instanceof WebGLRenderingContext (the same as in browsers, where WebGL2RenderingContext doesn't inherit WebGLRenderingContext); check for WebGL 2 first, since the types make WebGL2RenderingContext extend WebGLRenderingContext and narrow the else branch to never.

Type Parameters ​

Type Parameter
T

Constructors ​

Constructor ​

ts
new WebGLContextConstructor(): never;

Defined in: types/desktop-engine.d.ts:3326

Always throws TypeError('Illegal constructor')

Returns ​

never

Methods ​

[hasInstance]() ​

ts
hasInstance: value is T;

Defined in: types/desktop-engine.d.ts:3328

Checks Object.prototype.toString.call(value) against the class name

Parameters ​

ParameterType
valueunknown

Returns ​

value is T

The SDK is released under the Apache License 2.0