Using GLFW In Scheme With glfw-gambit
Dec 31, 2012
1 minute read

I started a new project, hosted at bitbucket.org, called glfw-gambit. It wraps GLFW in Gambit-C’s FFI so that you can use the library to write scheme software.

Right now, the project is in pre-release state. I started at the top of glfw.h and worked my way down. Right now only part of the API is supported because I just haven’t gotten to wrapping it yet. A file called basic-test.scm contains a test of most of the API that I’ve implemented.

I think the wrapper should be interesting because in several cases I ended up writing embedded C using gambit’s C macros documented in gambit.h and the mem.c source file. As far as I can tell, there’s no offical documentation of this use, but a google search will yield multiple instances where people mention using it to solve FFI problems. Once you figure out how it works, it’s actually not a bad setup. I wish it had official documentation.

At any rate, progress on this might end up slowing because I already got most of what I need to host my samples and projects for PortableGLUE and my upcoming iOS app.