Cut-out empty enum groups earlier (results in reordering of exports) and...
[cl-glfw/jecs.git] / README
blob78a2e4307692a81ca2580fef5ec9af703bb718a9
1 Top-level ASDF packages:
3  * cl-glfw - GLFW bindings for Common Lisp.
4  * cl-glfw-opengl - OpenGL bindings for Common Lisp.
5  * cl-glfw-glu (requires cl-glfw-opengl) - OpenGL Utilities bindings for Common Lisp.
7 ABOUT
9 A public domain set of CFFI bindings and convenience macros for the GLFW, GLU
10 and OpenGL libraries.
12 The OpenGL bindings are automatically generated from the (supposedly) canonical
13 spec-files from http://www.opengl.org/registry/
15 The GLU binding was hand-coerced from a tidied up header file, through swig, so
16 it's pretty much a direct mapping onto the API.
18 cl-glfw is independent of cl-glfw-opengl (and cl-glfw-glu). cl-glfw-opengl and
19 cl-glfw-glu may be used without cl-glfw. cl-glfw-glu, however, does depend on
20 cl-glfw-opengl. So, you should be able to use cl-glfw and
21 cl-glfw-opengl/cl-glfw-glu independently of each other; for example, using
22 cl-glfw with cl-opengl, or cl-opengl's glut with cl-glfw-opengl, should work
23 fine.
25 Check out the examples/ directory for more of a guide through.
28 THREADING
30 GLFW threading WILL PROBABLY BREAK YOUR LISP. I would advise seeking other
31 avenues if you require threading in your applications. The bindings remain in
32 cl-glfw, but, I should emphasise once again, that they probably are going to
33 mess up things like garbage collection in your lisp, and apparently some things
34 to do with stacks and allocations aswell.
37 NAME MANGLING STYLE
39 All function/constant names are 'lispified', that is dash-separated, instead of
40 camel-case.  Suffixes and acronyms are kept together as one word. Library
41 prefixes are expressed as their package. Constants are surrounded by the '+'
42 characters as lisp convention dictates.  Some examples:
44 glfwOpenWindow -> glfw:open-window
45 glVertex3fv -> gl:vertex-3fv
46 gluBuild2DMipmaps -> glu:build-2d-mipmaps
47 GL_FOG_INDEX -> gl:+fog-index+
48 GL_LIGHT0 -> gl:+light-0+
51 TYPE CONVERSION IN CL-GLFW-OPENGL
53 Functions that take a predictable c-array input or return an output have
54 automatic-translators for lisp-sequences (array and vectors). However, this
55 will require an extra allocation. cffi:pointer types will be passed straight
56 through. Eg. (gl:vertex-3fv #(1.0 0.0 1.0)) will work as expected.
58 All function parameters of types (warning: not in GLU yet) GLfloat or GLdouble
59 are automatically wrapped in an appropriate coerce. All integer types are
60 expected to be acceptable to CFFI. 
62 See individual function documentation for cl-glfw conversion details.
63 cl-glfw-glu does not do automatic float translations.
66 PLATFORMS
67     SBCL Linux x86
68     SBCL Linux amd64
69     SBCL Linux x86_64
70     Others: Let me know.
73 LINKS
75     http://repo.or.cz/w/cl-glfw.git - The working online git repository
76     http://glfw.sf.net/ - The homepage for GLFW
77     http://common-lisp.net/project/cffi/ - Dependency library CFFI's homepage
78     http://www.sbcl.org/ - Our favoured implementation of Common Lisp
79     http://www.opengl.org/ - OpenGL 3D graphics library API
82 ALTERNATIVES
84     http://common-lisp.net/project/cl-opengl/ - Alternative set of OpenGL (with GLUT) bindings
85     http://cl-sdl.sf.net/ - Seemingly abandoned SDL and OpenGL bindings
88 Enjoy.
89 Bill
90 airbaggins@users.sourceforge.net