浏览代码

Add webgl2 to Detector

Takahiro 7 年之前
父节点
当前提交
3f0dfd9f1f
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      examples/js/Detector.js

+ 13 - 0
examples/js/Detector.js

@@ -18,6 +18,19 @@ var Detector = {
 
 		}
 
+	} )(),
+	webgl2: ( function () {
+
+		try {
+
+			var canvas = document.createElement( 'canvas' ); return !! ( window.WebGL2RenderingContext && ( canvas.getContext( 'webgl2' ) ) );
+
+		} catch ( e ) {
+
+			return false;
+
+		}
+
 	} )(),
 	workers: !! window.Worker,
 	fileapi: window.File && window.FileReader && window.FileList && window.Blob,