In general, staying on the purely functional side will most likely kill your performance. You will need some mutation (I'd like to be proven otherwise, though). And not mutation via refs and so on, but mutation in the Java sense. So you'll have to create some Java classes for your game objects
It's possible to generate those classes from Clojure via gen-struct (http://bit.ly/mHzkX), which is a modification of genclass.clj. -Roland On Aug 30, 6:01 am, 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 -~----------~----~----~----~------~----~------~--~---