Skip to content

Commit 581469b

Browse files
committed
check is WebGL is enabled.
1 parent 3671749 commit 581469b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/chronos_gl.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ class ChronosGL
7676
_canvas.height = _canvas.clientHeight;
7777
_aspect = _canvas.clientWidth / _canvas.clientHeight;
7878
gl = _canvas.getContext("experimental-webgl");
79+
if( gl == null) {
80+
throw new Exception('calling canvas.getContext("experimental-webgl") failed, make sure you run on a computer that supports WebGL, test here: http://get.webgl.org/');
81+
}
7982
ChronosGL.globalGL = gl;
8083

8184
//print( gl.getSupportedExtensions());

0 commit comments

Comments
 (0)