kmcallister / glassful

Rust-like syntax for OpenGL Shading Language
Apache License 2.0
171 stars 14 forks source link

Overhaul syntax to use function parameters and returns #16

Closed loafofpiecrust closed 9 years ago

loafofpiecrust commented 9 years ago

I've made changes that allow (not force) the merging of shader stages into one invokation of glassful. Each stage's main is marked by an attribute of the stage. Everything besides a stage's main is copied into every stage, not including other stages' mains. Function parameters not mut become in values in glsl, and parameters marked mut become out values, and if there's a return value, then that becomes the very last out value. A couple uppercase types are converted into glsl types as well, including Pnt*, Vec*, Mat* into their (lowercase) glsl counterparts. The lowercase versions could still be used for function syntax if that is clearer. My changes to the README.md say more.

Be warned: shaders.rs has alot of things commented out, I've been playing with syntax there. But, what I've outlined should work.