I'm switching to use Elemental2, and it's fantastic. All the bindings I'll ever need. A big thank you to all that created it!
There are some strange things though. Like when setting up a WebGLRenderingContext, we need to pass WebGLContextAttributes.
However, doing:
WebGLContextAttributes contextAttributes = new WebGLContextAttributes();
compiles fine, but at runtime throws:
TypeError: $wnd.WebGLContextAttributes is not a constructor
I figured out I can do this instead:
WebGLContextAttributes contextAttributes = Js.uncheckedCast(JsPropertyMap.of());
But why can't I just use its constructor? Am I doing something wrong?