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

Re: [Public WebGL] Behavior of WebGL canvas when it can't make a backbuffer of the requested size?



Re thinking about this, getting a lost context for trying to set the canvas too large seems bad because there is no easy recovery from lost context.

In other words, if we had some kind of error (say, an exception?) I could do this

try {
  canvas.width = largeWidth;
  canvas.height = largeHeight;
} catch (e) {
  canvas.width = smallWidthOrPreviousWidth;
  canvas.height = smallHeightOrPreviousHeight;
}

But as it is, if I get lost context I now have to reload all my resources. That doesn't seem desirable