[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What new libraries or functionality does Guile need?

From: Maciek Godek
Subject: Re: What new libraries or functionality does Guile need?
Date: Sat, 19 Jul 2008 07:49:04 +0200

>> Hi-
>> If you could ask someone to write a library or package a set of
>> functionality for Guile that it doesn't currently have, what would it
>> be? (My personal projects are near completion, and I may have some
>> Saturdays free.)
> Bindings for OpenGL/GLU/GLUT would be great.

They definitely wouldn't be disturbing. On the other hand, OpenGL is such flat
a library if it comes to structure, that it could be wiser to write a semi
automatic tool for making guile bindings from C headers, i.e. to
transform declarations like

// gl.h
#define GL_BYTE 0x1400
// ...
GLAPI void GLAPIENTRY glVertex3d(GLdouble x, GLdouble y, GLdouble z);


// gl-module.c
static SCM glVertex3d_scmwrapped(SCM x, SCM y, SCM z) {
  glVertex3d(scm_to_double(x), scm_to_double(y), scm_to_double(z));

// ...

void init() {
  scm_c_define_gsubr("glVertex3d", 3, 0, 0, glVertex3d_scmwrapped);
// ...

;; gl.scm
(define-module (gl))
(load-extension "gl-module" "init")
(define-public GL_BYTE 0x1400)
; ...
(export glVertex3d)

GL is a great library to start with, for it uses only the embedded C types

reply via email to

[Prev in Thread] Current Thread [Next in Thread]