Commits

evhan committed ebd87dd

readme

  • Participants
  • Parent commits 917ac49

Comments (0)

Files changed (1)

+## GLFW
+
+[GLFW](http://www.glfw.org/) bindings for Chicken Scheme.
+
+### Installation
+
+    $ git clone git://github.com/evhan/glfw.git
+    $ cd glfw
+    $ chicken-install
+
+### API
+
+Constant & function names & signatures match those of GLFW.
+
+### Example
+
+    (use gl glfw extras data-structures)
+
+    (define *width* 640)
+    (define *height* 480)
+    (define *colors* '(.2 .4 .6 .8))
+
+    (define-external (window_resize (integer width) (integer height)) void
+      (gl:Viewport 0 0 *width* *height*))
+
+    (define-external (window_charpress (char c) (integer t)) void
+      (when (eq? c #\q)
+        (exit)))
+
+    (glfwInit)
+    (glfwOpenWindow *width* *height* 8 8 8 8 8 8 GLFW_WINDOW)
+    (glfwSetWindowSizeCallback (location window_resize))
+    (glfwSetCharCallback (location window_charpress))
+    (glfwSetWindowTitle "Chicken Party!")
+    
+    (let COLORS!!! ()
+      (apply gl:ClearColor (shuffle *colors* random))
+      (gl:Clear gl:COLOR_BUFFER_BIT)
+      (glfwSwapBuffers)
+      (glfwWaitEvents)
+      (COLORS!!!))
+
+### Author
+
+Evan Hanson <evhan@thunktastic.com>
+
+The heavy lifting was done by Felix Winkelman's [bind egg][], I just fiddled
+with the header file and fixed up the output a bit. Bug reports should still go
+to me, though.
+
+### License
+
+WTFPL.
+
+[bind egg]: http://wiki.call-cc.org/egg/bind/