IIRC's one of Dart's goals was to normalize the inconsistencies that the browser defines. Thus, WebGL will always be “accessible” in the sense that the interfaces for it will always exist in Dart, and not in the browser you are working on, whether they are defined initially.
Supported by Wether or not supported by WebGL, it is probably best tested the same way as in Javascript:
WebGLRenderingContext gl = canvas.getContext("experimental-webgl");
If gl
is null, then WebGL is not supported. Otherwise it!
(BTW: just because window.WebGLRenderingContext
exists in Javascript does NOT mean that WebGL is supported! This only means that the browser is capable of sending WebGL commands. The system you are working on may not accept them. It's better to try to create a context and detect when it is not working.)
source share