Source

chicken-glfw / glfw.scm

Full commit
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
(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-safe-lambda void glfwSwapBuffers))
  (define glfwSwapInterval (foreign-lambda void glfwSwapInterval integer))
  (define glfwGetWindowParam
    (foreign-lambda integer glfwGetWindowParam integer))
  (define glfwSetWindowSizeCallback
    (foreign-safe-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-safe-lambda void glfwPollEvents))
  (define glfwWaitEvents (foreign-safe-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)))