I'm experimenting with using core.async with game scripting. For testing
purposes, I put together a small sketch with quil.
The issue I'm having is that the quil sketch's draw function seems to break
whenever the <!! operator is used. *Is thread-blocking in the draw
function a big issue?*
Quil doesn't even seem to report an exception. It just goes on to the next
frame, albeit at a VERY slow framerate.
For exception reporting, I am attempting to draw the exception text to the
screen. Is that an issue? *If there is an exception, how do I report it?*
(println doesn't seem to work)
Thanks
Here's my code:
First off, I'm drawing a test ellipse and test text to make sure it works.
Next up, I'm using the beacon channel to invoke a state update, which
includes rendering functions. I'm using <!! to wait for a notification
message that the update is complete.
It draws the ellipse and frame-counter, but only gets as far as displaying
"Putting beacon...". Neither the "State..." or the "Error..." text is seen
on the output screen.
(defn draw-state [{:keys [beacon
beacon-notify]
:as state}]
(q/background 0)
(q/fill 255)
;; LEFTOFF: Why is the framerate so slow?
(q/ellipse 200 200 50 50)
(q/fill 0 255 0)
(q/text (str "Frame-counter: " (swap! framecounter inc)) 0 20)
(try (do
(q/text "Putting beacon..."0 40)
(put! beacon true)
(let [ns (<!! beacon-notify)]
(q/fill 255)
(q/text (str "State: " ns) 0 60)))
(catch Exception e
(q/fill 255 0 0)
(q/text (str "Error: " e 0 60))))
state)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.