Sunday, July 27, 2025

Elemental2 oddities

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?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/3c576a5d-1e89-427d-8a8c-1a1c691bdf20n%40googlegroups.com.

No comments:

Post a Comment