Hi- Now that the extension registry is live, I'd like to propose an extension to give both app and browser developers the tools to test lost context events. As it stands now, these are difficult to test because many platforms don't have lost context events and additionally there's no way to programmatically force the loss of a context from Javascript. It'd also be nice to get a conformance test in for this part of the WebGL spec. I've attached a draft of this extension to this email. Feedback welcomed. :) Regards, -AdrienneTitle: WebGL OES_texture_float Extension Specification
WEBGL_lose_context
Adrienne Walker, Google
Last modified date: December 6, 2010
Revision: 1
WebGL extension #3
Written against the WebGL API 1.0 specification.
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.
module webgl {
interface WEBGL_lose_context {
void loseContext();
void restoreContext();
};
};
When this function is called, it dispatches a webglcontextlost event. The behavior of the WebGL context after this event is identical to that after a real context lost event. If the context is already lost when this function is called, it will generate an INVALID_OPERATION error and no event will be dispatched.
When this function is called, a webglcontextrestored event will be dispatched if a handler for that event has been installed on the canvas associated with the WebGL context. The behavior of a context after this event is identical to that after a real context restored event. If there is no handler installed, then calling this function does nothing. If the context is not lost when the function is called, then it will generate an INVALID_OPERATION error and no event will be dispatched.
Revision 1, 2010/12/06