[Public WebGL] How to check for WebGL support
Thu May 19 10:40:35 PDT 2011
I like that idea a lot. Keep it simple and clean for the developers, and
efficient. I say yes.
On Thu, May 19, 2011 at 10:37 AM, Vangelis Kokkevis <[email protected]>wrote:
> A recurring issue with sites that want to use WebGL is that there's
> currently no good light-weight way to check whether WebGL is supported in a
> particular client. We have a couple of mechanisms in place but they all have
> 1. Statically check for window.WebGLRenderingContext : This will return
> false positives, e.g. when running on blacklisted configurations, when WebGL
> is explicitly disabled via some user pref, etc.
> 2. Create a WebGL context and inspect the result : Creating a context is
> expensive (slow) and when you only need to know whether WebGL is supported
> the resulting context isn't really needed.
> One possible solution would be to define window.WebGLRenderingContext only
> if both the browser supports WebGL and all the blacklist / user-pref / etc.
> tests succeed. Current pages will have to be tweaked to report a more
> generic "WebGL is not supported on your configuration" type of message
> rather than "Your browser does not support WebGL". If they really need to
> know why it's not supported they can go one step further and try to create
> the WebGL context and decipher any context creation error.
> Obviously there will still be some false positives with this mechanism but
> they will hopefully be rare.
Tony Parisi [email protected]
CTO at Large 415.902.8002
Follow me on Twitter! http://twitter.com/auradeluxe
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the public_webgl