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

Re: [Public WebGL] Handling context lost in WebGL


function init() {
  canvas.removeEventListener(‘mousemove’, mouseMoveHandler, false);
  mouseUniformLocation = gl.getUniformLocation(program, “uMouse”);
  function mouseMoveHandler(event) {
    gl.uniform2f(mouseIniformLocation, event.x, event.y);

  canvas.addEventListener(‘mousemove’, mouseMoveHandler, false);

do you really need the first line? Since the handler is no longer an anonymous function, it should use the current value of mouseUniformLocation when called.

I think this is a very useful document. Thanks for preparing it.



On 13/10/2011 10:25, Gregg Tavares (wrk) wrote:
I just got through updating all the demos on the Khronos WebGL SDK to handle context lost

I wrote up some of the issues I ran into and their solutions and put them on the WebGL Wiki here


I hope that's useful.