Преглед на файлове

I think these are the proper ways to detect <canvas> and WebGL.

Mr.doob преди 14 години
родител
ревизия
5ad6b0b59a
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      src/extras/Detector.js

+ 3 - 3
src/extras/Detector.js

@@ -6,8 +6,8 @@ THREE.Detector = {
 	
 	// supported features
 	
-	canvas	: !!document.createElement( 'canvas' ).getContext,
-	webgl	: window.Uint8Array != undefined,
+	canvas	: !!window.CanvasRenderingContext2D, // !!document.createElement( 'canvas' ).getContext,
+	webgl	: !!window.WebGLRenderingContext, // window.Uint8Array != undefined,
 	workers : !!window.Worker,
 	
 	// helper methods
@@ -59,4 +59,4 @@ THREE.Detector = {
 
 	}
 	
-};
+};