dist/melonjs.js
function getContextGL(canvas, transparent) {
         if (typeof canvas === "undefined" || canvas === null) {
           throw new Error("You must pass a canvas element in order to create " + "a GL context");
         }

         if (typeof transparent !== "boolean") {
           transparent = true;
         }

         var attr = {
           alpha: transparent,
           antialias: this.settings.antiAlias,
           depth: false,
           stencil: true,
           premultipliedAlpha: transparent,
           failIfMajorPerformanceCaveat: this.settings.failIfMajorPerformanceCaveat
         };
         var gl = canvas.getContext("webgl", attr) || canvas.getContext("experimental-webgl", attr);

         if (!gl) {
           throw new Error("A WebGL context could not be created.");
         }

         return gl;
       }
function getContextGL(canvas, transparent) {
         if (typeof canvas === "undefined" || canvas === null) {
           throw new Error("You must pass a canvas element in order to create " + "a GL context");
         }

         if (typeof transparent !== "boolean") {
           transparent = true;
         }

         var attr = {
           alpha: transparent,
           antialias: this.settings.antiAlias,
           depth: false,
           stencil: true,
           premultipliedAlpha: transparent,
           failIfMajorPerformanceCaveat: this.settings.failIfMajorPerformanceCaveat
         };
         var gl = canvas.getContext("webgl", attr) || canvas.getContext("experimental-webgl", attr);

         if (!gl) {
           throw new Error("A WebGL context could not be created.");
         }

         return gl;
       }
function getContextGL ( canvas , transparent ) { if ( typeof canvas === "undefined" || canvas === null ) { throw new Error ( "You must pass a canvas element in order to create " + "a GL context" ) ; } if ( typeof transparent !== "boolean" ) { transparent = true ; } var attr = { alpha : transparent , antialias : this . settings . antiAlias , depth : false , stencil : true , premultipliedAlpha : transparent , failIfMajorPerformanceCaveat : this . settings . failIfMajorPerformanceCaveat } ; var gl = canvas . getContext ( "webgl" , attr ) || canvas . getContext ( "experimental-webgl" , attr ) ; if ( ! gl ) { throw new Error ( "A WebGL context could not be created." ) ; } return gl ; }
Returns the WebGL Context object of the given Canvas
@name getContextGL
@memberOf me.WebGLRenderer.prototype
@function
@param {Canvas} canvas
@param {Boolean} [transparent=true] use false to disable transparency
@return {WebGLRenderingContext}
Returns the WebGL Context object of the given Canvas