浏览代码

Enabling webGL 2

David Catuhe 8 年之前
父节点
当前提交
9f5d572918
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      src/babylon.engine.ts

+ 8 - 8
src/babylon.engine.ts

@@ -524,14 +524,14 @@
             var renderToHalfFloat = this._canRenderToHalfFloatTexture();
 
             // GL
-            //try {
-            //    this._gl = <WebGLRenderingContext>(canvas.getContext("webgl2", options) || canvas.getContext("experimental-webgl2", options));
-            //    if (this._gl) {
-            //        this._webGLVersion = "2.0";
-            //    }
-            //} catch (e) {
-            //    // Do nothing
-            //}
+            try {
+               this._gl = <WebGLRenderingContext>(canvas.getContext("webgl2", options) || canvas.getContext("experimental-webgl2", options));
+               if (this._gl) {
+                   this._webGLVersion = "2.0";
+               }
+            } catch (e) {
+               // Do nothing
+            }
 
             if (!this._gl) {
                 if (!canvas) {