function initWebGL(canvas) {

        var msg = 'Your browser does not support WebGL, ' + 'or it is not enabled by default.';

        try {
            gl = canvas.getContext('experimental-webgl');
            gl.viewport(0, 0, canvas.width, canvas.height);
        } catch (e) {
            msg = 'Error creating WebGL Context!: ' + e.toString();
        }

        if (!gl) {
            console.log(msg);
        }
    }
/**
     * Does some initial checking for WebGL support, before defining the cross-module variable `gl`.
     * @constructor
     * @class GL
     * @method initWebGL
     * @param  {DOMElement} canvas The canvas to get the context of.
     */
Does some initial checking for WebGL support, before defining the cross-module variable `gl`.
@constructor
@class GL
@method initWebGL
@param  {DOMElement} canvas The canvas to get the context of.
Does some initial checking for WebGL support before defining the cross - module variable ` gl ` . @constructor @class GL @method initWebGL @param { DOMElement } canvas The canvas to get the context of .
function initWebGL(canvas) {
        var msg = 'Your browser does not support WebGL, ' + 'or it is not enabled by default.';
        try {
            gl = canvas.getContext('experimental-webgl');
            gl.viewport(0, 0, canvas.width, canvas.height);
        } catch (e) {
            msg = 'Error creating WebGL Context!: ' + e.toString();
        }
        if (!gl) {
            console.log(msg);
        }
    }
function initWebGL ( canvas ) { var msg = 'Your browser does not support WebGL, ' + 'or it is not enabled by default.' ; try { gl = canvas . getContext ( 'experimental-webgl' ) ; gl . viewport ( 0 , 0 , canvas . width , canvas . height ) ; } catch ( e ) { msg = 'Error creating WebGL Context!: ' + e . toString ( ) ; } if ( ! gl ) { console . log ( msg ) ; } }
Does some initial checking for WebGL support, before defining the cross-module variable `gl`.
Does some initial checking for WebGL support before defining the cross - module variable ` gl ` .