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
new WebGLContextConstructor(): never;Defined in: types/desktop-engine.d.ts:3326
Always throws TypeError('Illegal constructor')
Returns
never
Methods
[hasInstance]()
hasInstance: value is T;Defined in: types/desktop-engine.d.ts:3328
Checks Object.prototype.toString.call(value) against the class name
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
value is T
