Trying to initialise sketch :size with a vector

13 views
Skip to first unread message

Ricardo Sanchez

unread,
Jan 22, 2014, 6:24:25 PM1/22/14
to clj-pro...@googlegroups.com
I would like to initialise the sketch size attribute with a vector, here is what I have:

(def window-size [640 480])

(defsketch quil-examples
  :title "Quil Example 02"
  :setup setup
  :draw draw
  :size window-size)

But I'm getting a error if I change the :size line to 

  :size [(window-size 0) (window-size 1)])

It works fine, I thinking is if size accepts a vector why this does not work?

Any help will be much appreciated

Nikita Beloglazov

unread,
Jan 22, 2014, 6:43:21 PM1/22/14
to clj-pro...@googlegroups.com
Hi Ricardo

Unfortunately it's a bug in quil. There is an opened bug and opened pull request that fixes the issue, but it's merged yet.

The problem is quil "thinks" that all symbols in defsketch macro are functions and processes them in specific way. For now you can use your workaround or may be you can try :size (vec window-size) which is also ugly and pointless but should work.

Nikita


--
You received this message because you are subscribed to the Google Groups "clj-processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clj-processin...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages