Hi, I'm using Clojure together with Processing and JBox2D to write small, 2D physics-powered games. The constraint given by JBox2D is, that the physics simulation has to be run in and only accessed from the same thread. So the whole game simulation is confined to the physics simulation thread and a Java HashMap to keep track of player bodies. But Clojure helps splitting the game into several threads, for rendering, simulation and networking. Currently I'm using Clojure vectors to share the state of the simulated world (JBox2D) with the rendering thread (Processing).
Processing also provides a way to use OpenGL as a renderer, but I haven't figured out yet how to setup it correctly. On 30 Aug., 06:01, Elliott Slaughter <elliottslaugh...@gmail.com> wrote: > Hi, > > I'm visiting from the Common Lisp game-dev crowd and wanted to try out > Clojure for writing games. > > I saw some JOGL examples posted in this group, in addition to the > cloggle library which wraps some JOGL functionality. Cloggle is pretty > thin right now and uses glFunctionNames as they are, so I've added > some patches to convert glFunctionNames to Lispier function-names, and > tried to Lispify the interface in general [1]. > > I think I'd be fairly comfortable writing a graphics engine with my > patched version of cloggle. What I'm not so sure about is writing the > game simulation model. > > All game simulation models I've seen used graphs of mutable objects; > I'm not entirely sure how to move to a more functional model. One the > one hand, reallocating the game world on every frame seems excessive > (even if Java's GC is fast), and on the other hand putting refs > everywhere a value could potentially change seems equally excessive > (and probably detrimental to performance). > > I just saw zippers on the other libraries page, but haven't had the > time to read it and don't know if it meets my needs or not. > > If anyone has suggestions on simulating interactions between trees of > objects (especially on the Clojure way to do it), I'd appreciate it. > Comments on my cloggle patches also welcome. > > [1]http://github.com/slaguth/cloggle/tree/master --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---