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

Re: [Public WebGL] Proposed change to WebGL Event definition



Sorry I didn't pay attention to this earlier

Maybe this isn't important but I was hoping the webglcontextcreationerror event would let me distinguish between at a minimum 2 situations (I can think of more).

#1) The browser does not support WebGL

#2) The browser does support WebGL but the hardware is not up to it.

Right now apparently the distinction is if I get the event then the browser supports webgl but the hardware is not up to it. Otherwise it wouldn't support the event.

But then how do I distinguish that from #1?  In the #1 case I call getContext("webgl") and if it returns null then what? 

    canvas.addEventListener(
      "webglcontextcreationerror",
      reportThatBrowserSupportsWebGLbutNotYourHardware);
  setTimeout(reportNoWebGL, 2000); //<---------????
  var gl = canvas.getContext("webgl");
  if (!gl) {
     // I don't know if context creation failed because the browser
     // doesn't support webgl or because of some other reason.
     // pray that 2 seconds is enough time to wait for the event.
     


Maybe #2 doesn't matter. Old hardware is dying out. Software renderers will eventually be available or something so either you have WebGL or your browser doesn't support it

But in that case there is no need for webglcontextcreationerror is there? It's only point was to provide a way to get info as to why the context creation failed. If there is no usable info (ie, something a program can use to determine why) then getting null from getContext is all you need.