WebGL
Khronos
 

WebGL WEBGL_lose_context Khronos Ratified Extension Specification

Name

WEBGL_lose_context

Contact

enne@chromium.org

Contributors

Members of the WebGL working group

Glenn Maynard

Version

Last modified date: August 02, 2013
Revision: 11

Number

WebGL extension #3

Dependencies

Written against the WebGL API 1.0 specification.

Overview

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:

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.

Alias Name Strings (for draft extensions)

IDL

interface WEBGL_lose_context {
      void loseContext();
      void restoreContext();
};
  

New Functions

void loseContext()
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.
void restoreContext()
When this function is called, the context is lost, and the conditions defined by the WebGL specification for restoring the context are met, simulate the context being restored so as to trigger the steps described in the WebGL spec for handling the context being restored. If the context is already restored when this function is called, or if the conditions in the WebGL specification for restoring the context are not satisfied, generate an INVALID_OPERATION error.

Revision History

Revision 1, 2011/01/11

Revision 2, 2011/04/14

Revision 3, 2011/11/08

Revision 4, 2011/11/11

Revision 5, 2011/12/06

Revision 6, 2011/12/07

Revision 7, 2012/01/03

Revision 8, 2013/01/26

Revision 9, 2013/05/15

Revision 10, 2013/06/05

Revision 11, 2013/08/02