all files / src/core/ vendor.js

82.35% Statements 14/17
50% Branches 9/18
0% Functions 0/1
82.35% Lines 14/17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                
var supportWebGL = true;
try {
    var canvas = document.createElement('canvas');
    var gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
    Iif (!gl) {
        throw new Error();
    }
} catch (e) {
    supportWebGL = false;
}
 
var vendor = {};
 
/**
 * If support WebGL
 * @return {boolean}
 */
vendor.supportWebGL = function () {
    return supportWebGL;
};
 
 
vendor.Int8Array = typeof Int8Array == 'undefined' ? Array : Int8Array;
 
vendor.Uint8Array = typeof Uint8Array == 'undefined' ? Array : Uint8Array;
 
vendor.Uint16Array = typeof Uint16Array == 'undefined' ? Array : Uint16Array;
 
vendor.Uint32Array = typeof Uint32Array == 'undefined' ? Array : Uint32Array;
 
vendor.Int16Array = typeof Int16Array == 'undefined' ? Array : Int16Array;
 
vendor.Float32Array = typeof Float32Array == 'undefined' ? Array : Float32Array;
 
vendor.Float64Array = typeof Float64Array == 'undefined' ? Array : Float64Array;
 
export default vendor;