separate webgl capability detector in main.js, keep track
parent
c60596d79c
commit
840058d4c1
10
main.js
10
main.js
|
@ -40,6 +40,16 @@ $(document).ready(function () {
|
|||
GUI.log('You\'re using an old version of ' + chrome.runtime.getManifest().name + '. Please update so you can benefit from recently added features and bugfixes.');
|
||||
}
|
||||
|
||||
// log webgl capability
|
||||
// it would seem the webgl "enabling" through advanced settings will be ignored in the future
|
||||
// and webgl will be supported if gpu supports it by default (canary 40.0.2175.0), keep an eye on this one
|
||||
var canvas = document.createElement('canvas');
|
||||
if (window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl'))) {
|
||||
googleAnalytics.sendEvent('Capability', 'WebGL', 'true');
|
||||
} else {
|
||||
googleAnalytics.sendEvent('Capability', 'WebGL', 'false');
|
||||
}
|
||||
|
||||
// log library versions in console to make version tracking easier
|
||||
console.log('Libraries: jQuery - ' + $.fn.jquery + ', d3 - ' + d3.version + ', three.js - ' + THREE.REVISION);
|
||||
|
||||
|
|
|
@ -317,7 +317,11 @@ TABS.setup.initialize3D = function (compatibility) {
|
|||
wrapper = $('.CAP_BASEFLIGHT_CONFIG #canvas_wrapper');
|
||||
}
|
||||
|
||||
if (window.WebGLRenderingContext && (canvas.get(0).getContext('webgl') || canvas.get(0).getContext('experimental-webgl'))) {
|
||||
// webgl capability detector
|
||||
// it would seem the webgl "enabling" through advanced settings will be ignored in the future
|
||||
// and webgl will be supported if gpu supports it by default (canary 40.0.2175.0), keep an eye on this one
|
||||
var detector_canvas = document.createElement('canvas');
|
||||
if (window.WebGLRenderingContext && (detector_canvas.getContext('webgl') || detector_canvas.getContext('experimental-webgl'))) {
|
||||
renderer = new THREE.WebGLRenderer({canvas: canvas.get(0), alpha: true, antialias: true});
|
||||
} else {
|
||||
renderer = new THREE.CanvasRenderer({canvas: canvas.get(0), alpha: true});
|
||||
|
|
Loading…
Reference in New Issue