(define-macro (bind-glew glew-lib proc-name type . args)
(let* ((arg-types (cddr (impc:ir:get-type-from-pretty-str (symbol->string type))))
(arg-list (glwrapper-arg-list-symbols (length arg-types))))
`(begin (eval (bind-lib
,glew-lib
,(glew-name-from-gl-name proc-name)
,type)
(interaction-environment))
(eval (bind-func ,proc-name
;; docstring
,(if (and (not (null? args)) (string? (car args)))
(car args)
"")
(lambda ,arg-list
(,(glew-name-from-gl-name proc-name)
,@arg-list)))
(interaction-environment)))))