Version: pre-release (still in initial development)
Author: Timothy Bogdala firstname.lastname@example.org
glfw-gambit is a MIT licensed Gambit-C scheme wrapper for GLFW 2.x.
- Gambit-C 4.6.6
- Linux [Tested: Fedora 18]
- Mac OS X [Tested: 10.7.5]
- GLFW for Linux, Mac OS X and Windows hosts
- Gambit-C scheme
The main API is located in glfw.scm. The other scheme files are test programs.
Compiling on Linux
$ gsc -ld-options "-L/usr/local/lib -lglfw" -exe basic-test.scm
or, if you get a bunch of undefined references, you might need to link in more libraries:
$ gsc -ld-options "-L/usr/local/lib -lglfw -lGLU -lGL -lX11 -lrt" -exe basic-test.scm
Compiling on Mac OS X
This platform is complicated by a few things. Gambit-C defaults to building for x86, however GLFW builds for x86_64 which will cause a problem on linking. Gambit-C can be configured and built from source like this:
CFLAGS="-m64" ./configure --enable-single-host
[ed. note: using CFLAGS="-arch x86_64" failed the configure script. "--enable-gcc-opts" was not added to greatly reduce build time on my mac.]
After you have a 64 bit library of Gambit-C (check with "lipo -info /usr/local/Gambit-C/lib/libgambc.a"), you can build the tests of GLFW using a command line like below:
gsc -cc-options "-I/usr/X11R6/include -I/usr/local/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk" -ld-options "-L/usr/local/lib -lglfw" -exe basic-test.scm
All #define constantes in glfw.h were ported as is, with no changes to naming.
Currently Unimplemented Functions
All of the API should have the same parameters and behavior of the original C API. The following are the exceptions:
Returns a vector of #(major minor rev) representing the version number and does not take parameters.
Any glfw-vidmode* type returned by the API must be deallocated by passing it to glfw-vidmode-free.
The following accessor functions exist to access data members:
Returns a vector of #(width height) representing the window size and does not take parameters.
Returns a newly allocated glfw-vidmode* that must be deallocated with glfw-vidmode-free.
Takes a vector long enough to hold #(xpos ypos) as a parameter and populates the vector with the position.
All original code and assets in this distribution are released under the MIT license as described in the LICENSE file unless otherwise noted.