Created
September 29, 2012 16:17
-
-
Save timmc/3804489 to your computer and use it in GitHub Desktop.
Swing threads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn make-human-move | |
"Block until human has moved, then return move." | |
[g] | |
(SwingUtilities/invokeLater #(update-ui-game-state g human-player-id)) | |
(reset! human-turn? true) | |
;; Block until human has moved | |
(.take human-moves)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timmc@thunk:~/repos/crosscram$ lein run -m crosscram.demo | |
(#<Thread Thread[Game loop,5,main]>) | |
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException | |
at java.awt.geom.Path2D$Float.<init>(Path2D.java:232) | |
at java.awt.geom.Path2D$Float.<init>(Path2D.java:207) | |
at sun.java2d.pipe.LoopPipe.fill(LoopPipe.java:300) | |
at sun.java2d.pipe.PixelToParallelogramConverter.fill(PixelToParallelogramConverter.java:164) | |
at sun.java2d.pipe.ValidatePipe.fill(ValidatePipe.java:160) | |
at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2422) | |
at crosscram.demo$render_game.invoke(demo.clj:189) | |
at crosscram.demo$update_ui_game_state.invoke(demo.clj:212) | |
at crosscram.demo$make_human_move$fn__177.invoke(demo.clj:130) | |
at clojure.lang.AFn.run(AFn.java:24) | |
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226) | |
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:670) | |
at java.awt.EventQueue.access$400(EventQueue.java:96) | |
at java.awt.EventQueue$2.run(EventQueue.java:631) | |
at java.awt.EventQueue$2.run(EventQueue.java:629) | |
at java.security.AccessController.doPrivileged(Native Method) | |
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105) | |
at java.awt.EventQueue.dispatchEvent(EventQueue.java:640) | |
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275) | |
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200) | |
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) | |
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185) | |
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177) | |
at java.awt.EventDispatchThread.run(EventDispatchThread.java:138) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment