This extension exposes new functions which simulate losing and restoring the WebGL context, even on platforms where the context can never be lost. Consult the WebGL specification for documentation about the webglcontextlost
and webglcontextrestored
events.
When this extension is enabled:
loseContext
and restoreContext
are allowed to generate INVALID_OPERATION errors even when the context is lost.Note that this extension is not disconnected from the WebGLRenderingContext if that object loses its context as described in "The Context Lost Event" of the WebGL specification, either through use of this API or via actual circumstances such as a system failure.
When this function is called and the context is not lost, simulate
losing the context so as to trigger the steps described in the WebGL
spec for handling context lost. The context will remain in the lost
state according to the WebGL specification until
restoreContext()
is called. If the context is already
lost when this function is called, generate an
INVALID_OPERATION
error.
Implementations should destroy the underlying graphics context and all graphics resources when this method is called. This is the recommended mechanism for applications to programmatically halt their use of the WebGL API.
loseContext()
,
generate an INVALID_OPERATION
error.