Commits

evhan committed 64749c7

initial

Comments (0)

Files changed (3)

+((description "GLFW bindings")
+ (author "Evan Hanson")
+ (license "WTFPL")
+ (foreign-depends "GLFW"))
+(module glfw *
+  (import chicken scheme foreign)
+  (foreign-declare "#include <GL/glfw.h>")
+  (define-foreign-type GLFWimage "GLFWimage")
+  (define-foreign-type GLFWvidmode "GLFWvidmode")
+  (define GLFW_VERSION_MAJOR (foreign-value "GLFW_VERSION_MAJOR" integer))
+  (define GLFW_VERSION_MINOR (foreign-value "GLFW_VERSION_MINOR" integer))
+  (define GLFW_VERSION_REVISION (foreign-value "GLFW_VERSION_REVISION" integer))
+  (define GLFW_RELEASE (foreign-value "GLFW_RELEASE" integer))
+  (define GLFW_PRESS (foreign-value "GLFW_PRESS" integer))
+  (define GLFW_KEY_UNKNOWN (foreign-value "GLFW_KEY_UNKNOWN" integer))
+  (define GLFW_KEY_SPACE (foreign-value "GLFW_KEY_SPACE" integer))
+  (define GLFW_KEY_SPECIAL (foreign-value "GLFW_KEY_SPECIAL" integer))
+  (define GLFW_KEY_ESC (foreign-value "GLFW_KEY_ESC" integer))
+  (define GLFW_KEY_F1 (foreign-value "GLFW_KEY_F1" integer))
+  (define GLFW_KEY_F2 (foreign-value "GLFW_KEY_F2" integer))
+  (define GLFW_KEY_F3 (foreign-value "GLFW_KEY_F3" integer))
+  (define GLFW_KEY_F4 (foreign-value "GLFW_KEY_F4" integer))
+  (define GLFW_KEY_F5 (foreign-value "GLFW_KEY_F5" integer))
+  (define GLFW_KEY_F6 (foreign-value "GLFW_KEY_F6" integer))
+  (define GLFW_KEY_F7 (foreign-value "GLFW_KEY_F7" integer))
+  (define GLFW_KEY_F8 (foreign-value "GLFW_KEY_F8" integer))
+  (define GLFW_KEY_F9 (foreign-value "GLFW_KEY_F9" integer))
+  (define GLFW_KEY_F10 (foreign-value "GLFW_KEY_F10" integer))
+  (define GLFW_KEY_F11 (foreign-value "GLFW_KEY_F11" integer))
+  (define GLFW_KEY_F12 (foreign-value "GLFW_KEY_F12" integer))
+  (define GLFW_KEY_F13 (foreign-value "GLFW_KEY_F13" integer))
+  (define GLFW_KEY_F14 (foreign-value "GLFW_KEY_F14" integer))
+  (define GLFW_KEY_F15 (foreign-value "GLFW_KEY_F15" integer))
+  (define GLFW_KEY_F16 (foreign-value "GLFW_KEY_F16" integer))
+  (define GLFW_KEY_F17 (foreign-value "GLFW_KEY_F17" integer))
+  (define GLFW_KEY_F18 (foreign-value "GLFW_KEY_F18" integer))
+  (define GLFW_KEY_F19 (foreign-value "GLFW_KEY_F19" integer))
+  (define GLFW_KEY_F20 (foreign-value "GLFW_KEY_F20" integer))
+  (define GLFW_KEY_F21 (foreign-value "GLFW_KEY_F21" integer))
+  (define GLFW_KEY_F22 (foreign-value "GLFW_KEY_F22" integer))
+  (define GLFW_KEY_F23 (foreign-value "GLFW_KEY_F23" integer))
+  (define GLFW_KEY_F24 (foreign-value "GLFW_KEY_F24" integer))
+  (define GLFW_KEY_F25 (foreign-value "GLFW_KEY_F25" integer))
+  (define GLFW_KEY_UP (foreign-value "GLFW_KEY_UP" integer))
+  (define GLFW_KEY_DOWN (foreign-value "GLFW_KEY_DOWN" integer))
+  (define GLFW_KEY_LEFT (foreign-value "GLFW_KEY_LEFT" integer))
+  (define GLFW_KEY_RIGHT (foreign-value "GLFW_KEY_RIGHT" integer))
+  (define GLFW_KEY_LSHIFT (foreign-value "GLFW_KEY_LSHIFT" integer))
+  (define GLFW_KEY_RSHIFT (foreign-value "GLFW_KEY_RSHIFT" integer))
+  (define GLFW_KEY_LCTRL (foreign-value "GLFW_KEY_LCTRL" integer))
+  (define GLFW_KEY_RCTRL (foreign-value "GLFW_KEY_RCTRL" integer))
+  (define GLFW_KEY_LALT (foreign-value "GLFW_KEY_LALT" integer))
+  (define GLFW_KEY_RALT (foreign-value "GLFW_KEY_RALT" integer))
+  (define GLFW_KEY_TAB (foreign-value "GLFW_KEY_TAB" integer))
+  (define GLFW_KEY_ENTER (foreign-value "GLFW_KEY_ENTER" integer))
+  (define GLFW_KEY_BACKSPACE (foreign-value "GLFW_KEY_BACKSPACE" integer))
+  (define GLFW_KEY_INSERT (foreign-value "GLFW_KEY_INSERT" integer))
+  (define GLFW_KEY_DEL (foreign-value "GLFW_KEY_DEL" integer))
+  (define GLFW_KEY_PAGEUP (foreign-value "GLFW_KEY_PAGEUP" integer))
+  (define GLFW_KEY_PAGEDOWN (foreign-value "GLFW_KEY_PAGEDOWN" integer))
+  (define GLFW_KEY_HOME (foreign-value "GLFW_KEY_HOME" integer))
+  (define GLFW_KEY_END (foreign-value "GLFW_KEY_END" integer))
+  (define GLFW_KEY_KP_0 (foreign-value "GLFW_KEY_KP_0" integer))
+  (define GLFW_KEY_KP_1 (foreign-value "GLFW_KEY_KP_1" integer))
+  (define GLFW_KEY_KP_2 (foreign-value "GLFW_KEY_KP_2" integer))
+  (define GLFW_KEY_KP_3 (foreign-value "GLFW_KEY_KP_3" integer))
+  (define GLFW_KEY_KP_4 (foreign-value "GLFW_KEY_KP_4" integer))
+  (define GLFW_KEY_KP_5 (foreign-value "GLFW_KEY_KP_5" integer))
+  (define GLFW_KEY_KP_6 (foreign-value "GLFW_KEY_KP_6" integer))
+  (define GLFW_KEY_KP_7 (foreign-value "GLFW_KEY_KP_7" integer))
+  (define GLFW_KEY_KP_8 (foreign-value "GLFW_KEY_KP_8" integer))
+  (define GLFW_KEY_KP_9 (foreign-value "GLFW_KEY_KP_9" integer))
+  (define GLFW_KEY_KP_DIVIDE (foreign-value "GLFW_KEY_KP_DIVIDE" integer))
+  (define GLFW_KEY_KP_MULTIPLY (foreign-value "GLFW_KEY_KP_MULTIPLY" integer))
+  (define GLFW_KEY_KP_SUBTRACT (foreign-value "GLFW_KEY_KP_SUBTRACT" integer))
+  (define GLFW_KEY_KP_ADD (foreign-value "GLFW_KEY_KP_ADD" integer))
+  (define GLFW_KEY_KP_DECIMAL (foreign-value "GLFW_KEY_KP_DECIMAL" integer))
+  (define GLFW_KEY_KP_EQUAL (foreign-value "GLFW_KEY_KP_EQUAL" integer))
+  (define GLFW_KEY_KP_ENTER (foreign-value "GLFW_KEY_KP_ENTER" integer))
+  (define GLFW_KEY_KP_NUM_LOCK (foreign-value "GLFW_KEY_KP_NUM_LOCK" integer))
+  (define GLFW_KEY_CAPS_LOCK (foreign-value "GLFW_KEY_CAPS_LOCK" integer))
+  (define GLFW_KEY_SCROLL_LOCK (foreign-value "GLFW_KEY_SCROLL_LOCK" integer))
+  (define GLFW_KEY_PAUSE (foreign-value "GLFW_KEY_PAUSE" integer))
+  (define GLFW_KEY_LSUPER (foreign-value "GLFW_KEY_LSUPER" integer))
+  (define GLFW_KEY_RSUPER (foreign-value "GLFW_KEY_RSUPER" integer))
+  (define GLFW_KEY_MENU (foreign-value "GLFW_KEY_MENU" integer))
+  (define GLFW_KEY_LAST (foreign-value "GLFW_KEY_LAST" integer))
+  (define GLFW_MOUSE_BUTTON_1 (foreign-value "GLFW_MOUSE_BUTTON_1" integer))
+  (define GLFW_MOUSE_BUTTON_2 (foreign-value "GLFW_MOUSE_BUTTON_2" integer))
+  (define GLFW_MOUSE_BUTTON_3 (foreign-value "GLFW_MOUSE_BUTTON_3" integer))
+  (define GLFW_MOUSE_BUTTON_4 (foreign-value "GLFW_MOUSE_BUTTON_4" integer))
+  (define GLFW_MOUSE_BUTTON_5 (foreign-value "GLFW_MOUSE_BUTTON_5" integer))
+  (define GLFW_MOUSE_BUTTON_6 (foreign-value "GLFW_MOUSE_BUTTON_6" integer))
+  (define GLFW_MOUSE_BUTTON_7 (foreign-value "GLFW_MOUSE_BUTTON_7" integer))
+  (define GLFW_MOUSE_BUTTON_8 (foreign-value "GLFW_MOUSE_BUTTON_8" integer))
+  (define GLFW_MOUSE_BUTTON_LAST (foreign-value "GLFW_MOUSE_BUTTON_LAST" integer))
+  (define GLFW_MOUSE_BUTTON_LEFT (foreign-value "GLFW_MOUSE_BUTTON_LEFT" integer))
+  (define GLFW_MOUSE_BUTTON_RIGHT (foreign-value "GLFW_MOUSE_BUTTON_RIGHT" integer))
+  (define GLFW_MOUSE_BUTTON_MIDDLE (foreign-value "GLFW_MOUSE_BUTTON_MIDDLE" integer))
+  (define GLFW_JOYSTICK_1 (foreign-value "GLFW_JOYSTICK_1" integer))
+  (define GLFW_JOYSTICK_2 (foreign-value "GLFW_JOYSTICK_2" integer))
+  (define GLFW_JOYSTICK_3 (foreign-value "GLFW_JOYSTICK_3" integer))
+  (define GLFW_JOYSTICK_4 (foreign-value "GLFW_JOYSTICK_4" integer))
+  (define GLFW_JOYSTICK_5 (foreign-value "GLFW_JOYSTICK_5" integer))
+  (define GLFW_JOYSTICK_6 (foreign-value "GLFW_JOYSTICK_6" integer))
+  (define GLFW_JOYSTICK_7 (foreign-value "GLFW_JOYSTICK_7" integer))
+  (define GLFW_JOYSTICK_8 (foreign-value "GLFW_JOYSTICK_8" integer))
+  (define GLFW_JOYSTICK_9 (foreign-value "GLFW_JOYSTICK_9" integer))
+  (define GLFW_JOYSTICK_10 (foreign-value "GLFW_JOYSTICK_10" integer))
+  (define GLFW_JOYSTICK_11 (foreign-value "GLFW_JOYSTICK_11" integer))
+  (define GLFW_JOYSTICK_12 (foreign-value "GLFW_JOYSTICK_12" integer))
+  (define GLFW_JOYSTICK_13 (foreign-value "GLFW_JOYSTICK_13" integer))
+  (define GLFW_JOYSTICK_14 (foreign-value "GLFW_JOYSTICK_14" integer))
+  (define GLFW_JOYSTICK_15 (foreign-value "GLFW_JOYSTICK_15" integer))
+  (define GLFW_JOYSTICK_16 (foreign-value "GLFW_JOYSTICK_16" integer))
+  (define GLFW_JOYSTICK_LAST (foreign-value "GLFW_JOYSTICK_LAST" integer))
+  (define GLFW_WINDOW (foreign-value GLFW_WINDOW integer))
+  (define GLFW_FULLSCREEN (foreign-value "GLFW_FULLSCREEN" integer))
+  (define GLFW_OPENED (foreign-value "GLFW_OPENED" integer))
+  (define GLFW_ACTIVE (foreign-value "GLFW_ACTIVE" integer))
+  (define GLFW_ICONIFIED (foreign-value "GLFW_ICONIFIED" integer))
+  (define GLFW_ACCELERATED (foreign-value "GLFW_ACCELERATED" integer))
+  (define GLFW_RED_BITS (foreign-value "GLFW_RED_BITS" integer))
+  (define GLFW_GREEN_BITS (foreign-value "GLFW_GREEN_BITS" integer))
+  (define GLFW_BLUE_BITS (foreign-value "GLFW_BLUE_BITS" integer))
+  (define GLFW_ALPHA_BITS (foreign-value "GLFW_ALPHA_BITS" integer))
+  (define GLFW_DEPTH_BITS (foreign-value "GLFW_DEPTH_BITS" integer))
+  (define GLFW_STENCIL_BITS (foreign-value "GLFW_STENCIL_BITS" integer))
+  (define GLFW_REFRESH_RATE (foreign-value "GLFW_REFRESH_RATE" integer))
+  (define GLFW_ACCUM_RED_BITS (foreign-value "GLFW_ACCUM_RED_BITS" integer))
+  (define GLFW_ACCUM_GREEN_BITS (foreign-value "GLFW_ACCUM_GREEN_BITS" integer))
+  (define GLFW_ACCUM_BLUE_BITS (foreign-value "GLFW_ACCUM_BLUE_BITS" integer))
+  (define GLFW_ACCUM_ALPHA_BITS (foreign-value "GLFW_ACCUM_ALPHA_BITS" integer))
+  (define GLFW_AUX_BUFFERS (foreign-value "GLFW_AUX_BUFFERS" integer))
+  (define GLFW_STEREO (foreign-value "GLFW_STEREO" integer))
+  (define GLFW_WINDOW_NO_RESIZE (foreign-value "GLFW_WINDOW_NO_RESIZE" integer))
+  (define GLFW_FSAA_SAMPLES (foreign-value "GLFW_FSAA_SAMPLES" integer))
+  (define GLFW_OPENGL_VERSION_MAJOR (foreign-value "GLFW_OPENGL_VERSION_MAJOR" integer))
+  (define GLFW_OPENGL_VERSION_MINOR (foreign-value "GLFW_OPENGL_VERSION_MINOR" integer))
+  (define GLFW_OPENGL_FORWARD_COMPAT (foreign-value "GLFW_OPENGL_FORWARD_COMPAT" integer))
+  (define GLFW_OPENGL_DEBUG_CONTEXT (foreign-value "GLFW_OPENGL_DEBUG_CONTEXT" integer))
+  (define GLFW_OPENGL_PROFILE (foreign-value "GLFW_OPENGL_PROFILE" integer))
+  (define GLFW_OPENGL_CORE_PROFILE (foreign-value "GLFW_OPENGL_CORE_PROFILE" integer))
+  (define GLFW_OPENGL_COMPAT_PROFILE (foreign-value "GLFW_OPENGL_COMPAT_PROFILE" integer))
+  (define GLFW_MOUSE_CURSOR (foreign-value "GLFW_MOUSE_CURSOR" integer))
+  (define GLFW_STICKY_KEYS (foreign-value "GLFW_STICKY_KEYS" integer))
+  (define GLFW_STICKY_MOUSE_BUTTONS (foreign-value "GLFW_STICKY_MOUSE_BUTTONS" integer))
+  (define GLFW_SYSTEM_KEYS (foreign-value "GLFW_SYSTEM_KEYS" integer))
+  (define GLFW_KEY_REPEAT (foreign-value "GLFW_KEY_REPEAT" integer))
+  (define GLFW_AUTO_POLL_EVENTS (foreign-value "GLFW_AUTO_POLL_EVENTS" integer))
+  (define GLFW_WAIT (foreign-value "GLFW_WAIT" integer))
+  (define GLFW_NOWAIT (foreign-value "GLFW_NOWAIT" integer))
+  (define GLFW_PRESENT (foreign-value "GLFW_PRESENT" integer))
+  (define GLFW_AXES (foreign-value "GLFW_AXES" integer))
+  (define GLFW_BUTTONS (foreign-value "GLFW_BUTTONS" integer))
+  (define GLFW_NO_RESCALE_BIT (foreign-value "GLFW_NO_RESCALE_BIT" integer))
+  (define GLFW_ORIGIN_UL_BIT (foreign-value "GLFW_ORIGIN_UL_BIT" integer))
+  (define GLFW_BUILD_MIPMAPS_BIT (foreign-value "GLFW_BUILD_MIPMAPS_BIT" integer))
+  (define GLFW_ALPHA_MAP_BIT (foreign-value "GLFW_ALPHA_MAP_BIT" integer))
+  (define GLFW_INFINITY (foreign-value "GLFW_INFINITY" double))
+  (define GLFWvidmode-Width
+    (foreign-lambda*
+      integer
+      (((c-pointer GLFWvidmode) s))
+      "return(s->Width);"))
+  (define GLFWvidmode-Height
+    (foreign-lambda*
+      integer
+      (((c-pointer GLFWvidmode) s))
+      "return(s->Height);"))
+  (define GLFWvidmode-RedBits
+    (foreign-lambda*
+      integer
+      (((c-pointer GLFWvidmode) s))
+      "return(s->RedBits);"))
+  (define GLFWvidmode-BlueBits
+    (foreign-lambda*
+      integer
+      (((c-pointer GLFWvidmode) s))
+      "return(s->BlueBits);"))
+  (define GLFWvidmode-GreenBits
+    (foreign-lambda*
+      integer
+      (((c-pointer GLFWvidmode) s))
+      "return(s->GreenBits);"))
+  (define make-GLFWvidmode
+    (foreign-lambda*
+      (c-pointer GLFWvidmode)
+      ((integer Width)
+       (integer Height)
+       (integer RedBits)
+       (integer BlueBits)
+       (integer GreenBits))
+      "GLFWvidmode *tmp_ = (GLFWvidmode *)C_malloc(sizeof(GLFWvidmode));\ntmp_->Width = Width;\n\ntmp_->Height = Height;\n\ntmp_->RedBits = RedBits;\n\ntmp_->BlueBits = BlueBits;\n\ntmp_->GreenBits = GreenBits;\n\nC_return(tmp_);"))
+  (define GLFWimage-Width
+    (foreign-lambda*
+      integer
+      (((c-pointer GLFWimage) s))
+      "return(s->Width);"))
+  (define GLFWimage-Height
+    (foreign-lambda*
+      integer
+      (((c-pointer GLFWimage) s))
+      "return(s->Height);"))
+  (define GLFWimage-Format
+    (foreign-lambda*
+      integer
+      (((c-pointer GLFWimage) s))
+      "return(s->Format);"))
+  (define GLFWimage-BytesPerPixel
+    (foreign-lambda*
+      integer
+      (((c-pointer GLFWimage) s))
+      "return(s->BytesPerPixel);"))
+  (define GLFWimage-Data
+    (foreign-lambda*
+      (c-pointer unsigned-char)
+      (((c-pointer GLFWimage) s))
+      "return(s->Data);"))
+  (define make-GLFWimage
+    (foreign-lambda*
+      (c-pointer GLFWimage)
+      ((integer Width)
+       (integer Height)
+       (integer Format)
+       (integer BytesPerPixel)
+       ((c-pointer unsigned-char) Data))
+      "GLFWimage *tmp_ = (GLFWimage *)C_malloc(sizeof(GLFWimage));\ntmp_->Width = Width;\n\ntmp_->Height = Height;\n\ntmp_->Format = Format;\n\ntmp_->BytesPerPixel = BytesPerPixel;\n\ntmp_->Data = Data;\n\nC_return(tmp_);"))
+  (define glfwInit (foreign-lambda integer glfwInit ))
+  (define glfwTerminate (foreign-lambda void glfwTerminate ))
+  (define glfwGetVersion
+    (foreign-lambda void glfwGetVersion s32vector s32vector s32vector))
+  (define glfwOpenWindow
+    (foreign-lambda
+      integer
+      glfwOpenWindow
+      integer
+      integer
+      integer
+      integer
+      integer
+      integer
+      integer
+      integer
+      integer))
+  (define glfwOpenWindowHint
+    (foreign-lambda void glfwOpenWindowHint integer integer))
+  (define glfwCloseWindow (foreign-lambda void glfwCloseWindow ))
+  (define glfwSetWindowTitle
+    (foreign-lambda void glfwSetWindowTitle c-string))
+  (define glfwGetWindowSize
+    (foreign-lambda void glfwGetWindowSize s32vector s32vector))
+  (define glfwSetWindowSize
+    (foreign-lambda void glfwSetWindowSize integer integer))
+  (define glfwSetWindowPos
+    (foreign-lambda void glfwSetWindowPos integer integer))
+  (define glfwIconifyWindow (foreign-lambda void glfwIconifyWindow ))
+  (define glfwRestoreWindow (foreign-lambda void glfwRestoreWindow ))
+  (define glfwSwapBuffers (foreign-lambda void glfwSwapBuffers ))
+  (define glfwSwapInterval (foreign-lambda void glfwSwapInterval integer))
+  (define glfwGetWindowParam
+    (foreign-lambda integer glfwGetWindowParam integer))
+  (define glfwSetWindowSizeCallback
+    (foreign-lambda
+      void
+      glfwSetWindowSizeCallback
+      (function void (integer integer))))
+  (define glfwSetWindowCloseCallback
+    (foreign-lambda
+      void
+      glfwSetWindowCloseCallback
+      (function integer (void))))
+  (define glfwSetWindowRefreshCallback
+    (foreign-lambda
+      void
+      glfwSetWindowRefreshCallback
+      (function void (void))))
+  (define glfwGetVideoModes
+    (foreign-lambda
+      integer
+      glfwGetVideoModes
+      (c-pointer GLFWvidmode)
+      integer))
+  (define glfwGetDesktopMode
+    (foreign-lambda
+      void
+      glfwGetDesktopMode
+      (c-pointer GLFWvidmode)))
+  (define glfwPollEvents (foreign-lambda void glfwPollEvents ))
+  (define glfwWaitEvents (foreign-lambda void glfwWaitEvents ))
+  (define glfwGetKey (foreign-lambda integer glfwGetKey integer))
+  (define glfwGetMouseButton
+    (foreign-lambda integer glfwGetMouseButton integer))
+  (define glfwGetMousePos
+    (foreign-lambda void glfwGetMousePos s32vector s32vector))
+  (define glfwSetMousePos
+    (foreign-lambda void glfwSetMousePos integer integer))
+  (define glfwGetMouseWheel (foreign-lambda integer glfwGetMouseWheel ))
+  (define glfwSetMouseWheel
+    (foreign-lambda void glfwSetMouseWheel integer))
+  (define glfwSetKeyCallback
+    (foreign-lambda
+      void
+      glfwSetKeyCallback
+      (function void (integer integer))))
+  (define glfwSetCharCallback
+    (foreign-lambda
+      void
+      glfwSetCharCallback
+      (function void (integer integer))))
+  (define glfwSetMouseButtonCallback
+    (foreign-lambda
+      void
+      glfwSetMouseButtonCallback
+      (function void (integer integer))))
+  (define glfwSetMousePosCallback
+    (foreign-lambda
+      void
+      glfwSetMousePosCallback
+      (function void (integer integer))))
+  (define glfwSetMouseWheelCallback
+    (foreign-lambda
+      void
+      glfwSetMouseWheelCallback
+      (function void (integer))))
+  (define glfwGetJoystickParam
+    (foreign-lambda integer glfwGetJoystickParam integer integer))
+  (define glfwGetJoystickPos
+    (foreign-lambda integer glfwGetJoystickPos integer f32vector integer))
+  (define glfwGetJoystickButtons
+    (foreign-lambda
+      integer
+      glfwGetJoystickButtons
+      integer
+      u8vector
+      integer))
+  (define glfwGetTime (foreign-lambda double glfwGetTime ))
+  (define glfwSetTime (foreign-lambda void glfwSetTime double))
+  (define glfwSleep (foreign-lambda void glfwSleep double))
+  (define glfwExtensionSupported
+    (foreign-lambda integer glfwExtensionSupported c-string))
+  (define glfwGetProcAddress
+    (foreign-lambda (c-pointer void) glfwGetProcAddress c-string))
+  (define glfwGetGLVersion
+    (foreign-lambda void glfwGetGLVersion s32vector s32vector s32vector))
+  (define glfwCreateThread
+    (foreign-lambda
+      integer
+      glfwCreateThread
+      (function void ((c-pointer void)))
+      (c-pointer void)))
+  (define glfwDestroyThread
+    (foreign-lambda void glfwDestroyThread integer))
+  (define glfwWaitThread
+    (foreign-lambda integer glfwWaitThread integer integer))
+  (define glfwGetThreadID (foreign-lambda integer glfwGetThreadID ))
+  (define glfwCreateMutex
+    (foreign-lambda (c-pointer void) glfwCreateMutex ))
+  (define glfwDestroyMutex
+    (foreign-lambda void glfwDestroyMutex (c-pointer void)))
+  (define glfwLockMutex
+    (foreign-lambda void glfwLockMutex (c-pointer void)))
+  (define glfwUnlockMutex
+    (foreign-lambda void glfwUnlockMutex (c-pointer void)))
+  (define glfwCreateCond (foreign-lambda (c-pointer void) glfwCreateCond ))
+  (define glfwDestroyCond
+    (foreign-lambda void glfwDestroyCond (c-pointer void)))
+  (define glfwWaitCond
+    (foreign-lambda
+      void
+      glfwWaitCond
+      (c-pointer void)
+      (c-pointer void)
+      double))
+  (define glfwSignalCond
+    (foreign-lambda void glfwSignalCond (c-pointer void)))
+  (define glfwBroadcastCond
+    (foreign-lambda void glfwBroadcastCond (c-pointer void)))
+  (define glfwGetNumberOfProcessors
+    (foreign-lambda integer glfwGetNumberOfProcessors ))
+  (define glfwEnable (foreign-lambda void glfwEnable integer))
+  (define glfwDisable (foreign-lambda void glfwDisable integer))
+  (define glfwReadImage
+    (foreign-lambda
+      integer
+      glfwReadImage
+      c-string
+      (c-pointer GLFWimage)
+      integer))
+  (define glfwReadMemoryImage
+    (foreign-lambda
+      integer
+      glfwReadMemoryImage
+      (c-pointer void)
+      long
+      (c-pointer GLFWimage)
+      integer))
+  (define glfwFreeImage
+    (foreign-lambda void glfwFreeImage (c-pointer GLFWimage)))
+  (define glfwLoadTexture2D
+    (foreign-lambda integer glfwLoadTexture2D c-string integer))
+  (define glfwLoadMemoryTexture2D
+    (foreign-lambda
+      integer
+      glfwLoadMemoryTexture2D
+      (c-pointer void)
+      long
+      integer))
+  (define glfwLoadTextureImage2D
+    (foreign-lambda
+      integer
+      glfwLoadTextureImage2D
+      (c-pointer GLFWimage)
+      integer)))
+(compile -s -O3 -d0 -lglfw -J glfw.scm)
+(compile -s -O3 -d0 glfw.import.scm)
+(install-extension 'glfw
+  '("glfw.so" "glfw.import.so")
+  '((version "0.0.1")))