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

Re: [Public WebGL] Addition to WebGLContextLostEvent wrt extensions



On Fri, Apr 16, 2010 at 00:48, Gregg Tavares <gman@google.com> wrote:
With the Reset/Resetable, the program is free to pretty much ignore the event system and just write this

var clearId;
function start() {
  init();
  clearId = setInterval(mainLoop, 10);
}
function mainLoop() {
  if (context.isContextLost()) {
    if (context.reset()) {
      clearInterval(clearId);
      start();
    }
  }
}

I think this is a good argument for moving resetContext() into the ResettableEvent interface [1] so that we won't see such code in the wild, that could keep a mobile device CPU powered on because of 'abusive' polling when screen/GPU is off.


Regards,


[1] : or by Chris's naming, restoreContext() into RestorableEvent interface.