WebGL
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
webglcontextlostevent, use WEBGL_lose_context.loseContext().
Syntax
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, orwebglcontextrestored.
- : A string indicating the type of the event.
It is case-sensitive and should be one of
options- : An object that, in addition to the properties defined in Event/Event, has the following properties:
statusMessage- : A string with additional status information. It defaults to the empty string (
"").
- : A string with additional status information. It defaults to the empty string (
- : An object that, in addition to the properties defined in Event/Event, has the following properties:
Return value
A new WebGLContextEvent object.
Specifications
Browser compatibility
See also
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
