Open Zinggi opened 7 years ago
Also, because we've moved the Texture
into WebGL.Texture
, it may be worth changing it in the compiler from "WebGL.Texture"
to "WebGL.Texture.Texture"
.
I think it's also worth discussing changing Math.VectorN.VecN
to WebGL.Math.VecN
etc. via integrating just the constructors for these types into webgl directly. (kinda like I did here).
This way you could still use linear-algebra, but you could also use my library or some other library that operates on {x: Float, y: Float}
.
One argument for including the linear algebra types in webgl is this issue: https://github.com/elm-community/linear-algebra/issues/8 that broke the implicit contract between two libraries by changing the internal native representation.
In this issue I want to collect new features that would require a compiler change, as the compiler only infers certain types from a
[glsl| |]
block.The types that are currently supported are:
Things that would be nice to have:
The relevant lines for the compiler are here.
Interestingly, we can actually pass in types that the compiler doesn't support and it still works. However, the compiler won't be able to infer types and catch errors this way.
(To confirm this statement, try passing in a
Bool
. It works as expected, but you don't get a compiler error if you leave it out or pass aString
instead.)Once it's clear what types we actually need, I could open an issue or a pull request to the compiler.