[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Public WebGL] Extension proposal: WEBGL_lose_context



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,
-Adrienne
Title: WebGL OES_texture_float Extension Specification
WebGL
Khronos

WebGL WEBGL_lose_context Extension Specification

Name

WEBGL_lose_context

Contact

enne@chromium.org

Contributors

Adrienne Walker, Google

Version

Last modified date: December 6, 2010
Revision: 1

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.

IDL

module webgl {

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

};

New Procedures and Functions

void loseContext()

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.

void restoreContext()

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 History

Revision 1, 2010/12/06