You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GLSL allows functions to be overloaded, so it's possible to define multiple "classes" and "constructors" in this way. Since this is a reserved word in GLSL, I replaced it with self.
The text was updated successfully, but these errors were encountered:
I recently discovered a way to translate JavaScript classes into GLSL, but it seems that js2glsl cannot do this yet.
A JavaScript class could be written like this:
And then JS2GLSL could generate a struct with a "constructor" and an "instance method:"
Then a "class" could be initialized in GLSL:
Stuff an_instance = new(1.0,2.0);
GLSL allows functions to be overloaded, so it's possible to define multiple "classes" and "constructors" in this way. Since
this
is a reserved word in GLSL, I replaced it withself
.The text was updated successfully, but these errors were encountered: