Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Common Lisp bindings for SFML  (Read 6205 times)

0 Members and 1 Guest are viewing this topic.

grapesmoker

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Common Lisp bindings for SFML
« on: March 10, 2017, 04:44:34 pm »
Hello SFML community,

I discovered SFML some time ago when I was looking for nice toolkits for game development, and I like it very much. As a Lisp enthusiast, I've always wanted to do some kind of game development in Lisp, and when I found that there were C bindings for SFML, I figured it would be pretty straightforward to create bindings to the C libraries for Lisp. I set about doing just that, but then life intervened and I haven't quite finished the project. Still, I got an email recently inquiring into the state of things from someone who wanted to use it and I figured there was no point in not sharing this work with the community.

You can find the project at http://github.com/grapesmoker/cl-sfml. If you're familiar with Quicklisp, you should be able to just put it in your local-projects directory and do (ql:quickload :cl-sfml) to load the project. There's a file in the repo called progress.org which shows what parts of the C API have been implemented. If you run test-window.lisp, you should get a window with the words "hello world" in green and a red circle that you can move around via the keyboard.

Ok, that's not very impressive, but it's taken some time to get to this stage. My goal in writing these bindings was to create an idiomatic Lispy interface to the library, and I think I'm mostly on the right track here. One of the reasons why I'm putting this project out there now is that if there are any other Lispers who would like to work on it, I'd definitely welcome contributions. I think the logic of the bindings is pretty straightforward, but there are some things I haven't quite figure out how to do, like implement bindings to functions with callbacks. The other thing that I got bogged down in was the vector/matrix logic of the OpenGL functions; the goal here again is that the Lisp side should provide a single interface for all the functions regardless of type or vector/matrix size, as Lisp is dynamic. When I get back to working on this project, which I hope will be soon, that'll be what I focus on. Besides that, the last thing that needs to be implemented is the audio module. Lisp has its own good solutions for networking code, so I probably won't be doing that.

I welcome contributions and feedback from anyone who might be interested in this. Hopefully there are a few other Lispers out there who might want to pitch in to help take this project over the finish line; I haven't really seen any good high-level toolkits for graphics development in Lisp and I think these bindings would fill a currently-vacant niche.