HTML and CSS Reference
In-Depth Information
How Does One Test WebGL?
First, you need to find a web browser that supports WebGL. When trying to run a WebGL
application, a browser that does not support WebGL might give a message like the one shown
in Figure 11-1 .
Figure 11-1. Trying to run WebGL in a standard web browser
Currently, the release versions of both Google Chrome and Firefox support WebGL. When
you have a browser that can display WebGL, you need to write the code to make it happen.
You start that process by accessing the WebGL context instead of the Canvas 2d context. So,
instead of the following code, which we have used throughout this topic:
context = theCanvas . getContext ( "2d" );
We reference the experimental-webgl context, like this:
gl = theCanvas . getContext ( "experimental-webgl" );
Search WWH ::

Custom Search