Time to drop the cruft

The other day I asked people whether their browsers support the latest versions of the WebGL APIs. A lot of the WebGL code out there — including the lessons I’ve been putting together here — uses a lot of nasty code at the start so that it can support differences between older versions of the browsers that date from before the WebGL spec nailed things down. I call this code “compatibility cruft”, and getting rid of it would help a lot in making people feel less intimidated the first time they view source on a WebGL page.

The results are in, and it looks like it’s time for the compatibility cruft to go, which is excellent news. Everything tested seemed to use the new APIs apart from one reader’s Mac Chromium nightly, which couldn’t create a WebGL context even using the old pre-standard name — which means that WebGL wouldn’t have worked on it even with the compatibility cruft.

Here’s a table of the platforms tested:

Firefox Safari Chrome
Linux OK (3 tests) N/A OK (3 tests)
Mac OK (2 tests) OK (2 tests) Failed (1 test)
Windows OK (1 test) N/A OK (1 test)

There were also a few test reports that didn’t specify the OS, but as they were uniformly OK, it doesn’t change the results.

So, great news: the cruft can go, and our WebGL source code will start looking less intimidating. A definite win.

You can leave a response, or trackback from your own site.

Leave a Reply

Subscribe to RSS Feed Follow Learning WebGL on Twitter