git clone ''

(ql:quickload :cl-glfw)

Top-level ASDF packages:


A public domain set of CFFI bindings and convenience macros for the GLFW, GLU and OpenGL libraries.

The OpenGL bindings are automatically generated from the spec-files from

The GLU binding was hand-coerced from a tidied up header file, through swig, so it's pretty much a direct mapping onto the API.

cl-glfw is independent of cl-glfw-opengl-* and cl-glfw-glu. cl-glfw-opengl and cl-glfw-glu may be used without cl-glfw. cl-glfw-glu, however, does depend on cl-glfw-opengl. So, you should be able to use cl-glfw and cl-glfw-opengl/cl-glfw-glu independently of each other; for example, using cl-glfw with cl-opengl, or cl-opengl's glut with cl-glfw-opengl, should work fine.

Check out the examples/ directory for more of a guide through.


For SBCL on Windows, you will need to download the GLFW DLLs pack (, which you can find on

I would recommend either placing the MINGW version of the GLFW.dll in either your \WINDOWS\SYSTEM32 directory, or in the current directory for distributed binaries.


For SBCL on Mac OS X, you will want to have the libglfw.dylib somewhere where cl-glfw can find it. It's probably easiest to just include it in the current directory of your application.


GLFW threading WILL PROBABLY BREAK YOUR LISP IMAGE. I would advise seeking other avenues if you require threading in your applications. The bindings remain in cl-glfw, but, I should emphasise once again, that they probably are going to mess up things like garbage collection in your lisp, and apparently some things to do with stacks and allocations aswell.


All function/constant names are ‘lispified’, that is dash-separated, instead of camel-case. Suffixes and acronyms are kept together as one word. Library prefixes are expressed as their package. Constants are surrounded by the ‘+’ characters as lisp convention dictates. Some examples:

glfwOpenWindow → glfw:open-window glVertex3fv → gl:vertex-3fv gluBuild2DMipmaps → glu:build-2d-mipmaps GL_FOG_INDEX → gl:+fog-index+ GL_LIGHT0 → gl:+light-0+


Functions that take a predictable c-array input or return an output have automatic-translators for lisp-sequences (array and vectors). However, this will require an extra allocation. cffi:pointer types will be passed straight through. Eg. (gl:vertex-3fv #(1.0 0.0 1.0)) will work as expected.

All function parameters of types (warning: not in GLU yet) GLfloat or GLdouble are automatically wrapped in an appropriate coerce. All integer types are expected to be acceptable to CFFI.

See individual function documentation for cl-glfw conversion details. cl-glfw-glu does not do automatic float translations.

PLATFORMS SBCL Linux x86 SBCL Linux amd64/x86_64 SBCL Windows 32-bit SBCL Mac OS X 32-bit Intel Others: Let me know.

LINKS - The working online git repository - The homepage for GLFW - Dependency library CFFI's homepage - Our favoured implementation of Common Lisp - OpenGL 3D graphics library API

ALTERNATIVES - Alternative set of OpenGL (with GLUT) bindings - Seemingly abandoned SDL and OpenGL bindings

Enjoy. Bill