[plt-scheme] Re: image manipulation

From: John Kozak (jk at xylema.org)
Date: Thu Mar 25 13:50:32 EST 2004

[...]
> This has one benefit--less duplicated C code--but two problems:
>
> 1) To make the scheme code "aware of" the representation mappings
> involves either parsing GL header files or duplicating this
> information manually.
> 2) Scheme code that wanted to use the GL library portably would then
> _also_ have to be "aware of" these mappings.  Bleah!

Well, it's not _that_ bad: the C bit of the interface would contain
code like:
  
    scheme_add_global("silly-float-size",sizeof(GL_silly_float),mod_env);

and the scheme bit would use these values to map SRFI 4 homovectors to
SGL ones.  No _user_ code need ever know.

> In fact, what we _really_ need is a nice FFI-builder.  The SRFI-4 C
> code would then presumably be generated automatically from an
> interface specification.

there's SWIG...

John




Posted on the users mailing list.