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: May 15, 2013
Revision: 9
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.
Alias Name Strings (for draft extensions)
- WEBKIT_WEBGL_lose_context
- MOZ_WEBGL_lose_context
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
- Added explicit restoreContext() method based on discussion on public_webgl list, to enable testing of scenario where context stays lost for a period of time.
Revision 3, 2011/11/08
- Renamed from WEBKIT_lose_context to WEBGL_EXT_lose_context
Revision 4, 2011/11/11
- Changed to make it clear this extension should follow the WebGL spec for the steps involved in handling losing and restoring the context rather than just fire events.
Revision 5, 2011/12/06
- Added vendor-specific name strings for draft extension per discussion on WebGL mailing list
- Renamed from WEBGL_EXT_lose_context to WEBGL_lose_context
Revision 6, 2011/12/07
- Renamed "Name Strings" section to "Alias Name Strings".
Revision 7, 2012/01/03
- Removed webgl module per changes to Web IDL spec.
Revision 8, 2013/01/26
- Moved from draft to community approved status
Revision 9, 2013/05/15
- Ratified by Khronos Board of Promoters.