W3cubDocs

/Web APIs

WebGLContextEvent: WebGLContextEvent() constructor

The WebGLContextEvent() constructor creates a new WebGLContextEvent object.

Note: You typically don't need to call this constructor; the browser creates these objects automatically when WebGL context events get fired. To manually trigger a webglcontextlost event, use WEBGL_lose_context.loseContext().

Syntax

js

new WebGLContextEvent(type, options)

Parameters

type

A string indicating the type of the event. It is case-sensitive and should be one of webglcontextcreationerror, webglcontextlost, or webglcontextrestored.

options Optional

An object that, in addition to the properties defined in Event(), has the following properties:

statusMessage Optional

A string with additional status information. It defaults to the empty string ("").

Return value

A new WebGLContextEvent object.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
WebGLContextEvent 17 12 49 11 15 6 4.4 25 49 14 8 1.5

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WebGLContextEvent/WebGLContextEvent