asakeron / cljs-webgl

WebGL binding to ClojureScript
109 stars 14 forks source link

Threading support #3

Closed rm-hull closed 10 years ago

rm-hull commented 10 years ago

All methods that 'do something' to the gl-context should ideally return the gl-context. This will allow the -> threading macro to chain operations:

(-> 
  gl-context
  (clear-color-buffer 0.0 0.0 0.0 0.1)
  (clear-stencil-buffer 1)
  (draw shader draw-mode ....)

Probably only appropriate for functions in the buffer namespace

asakeron commented 10 years ago

That will defintely make the code prettier, thank you for your suggestion.

I implemented support for ->in 37a1d4697d3a003a628684ef6a709fe4e8e771ba

And you are right about it only being applicable to the buffer namespace as it is the only one to implement functions without return values.

I assume it is okay to close this issue now. Reopen if necessary.

rm-hull commented 10 years ago

:+1: