[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Extension proposal: WEBGL_lose_context
The implementation is here
An example of using it is here
Note: it does not work in Safari or Chrome because of bugs in WebKit. Once those bugs are fixed it should work there.
To use include webgl-debug.js then after creating your context call
ctx = WebGLDebugUtils.makeLostContextSimulatingContext(gl);
After that you can call ctx.loseContext and ctx.restoreContext to simulate the context getting lost and restored.
The one thing that's different is you can't use canvas.addEventListener('webglcontextlostevent', listener,...) . Instead you have to use ctx.registerOnContextLostListener. Same for webglcontextrestoredevent.
I don't see that difference as enough justification to clutter the register with an extension for this.