I've been working on some code to port a Lisp based software system from
AllegroCL to CMUCL.  Part of this project involves making calls to OpenGL
calls via functions like this one:

   NAME
          glXQueryExtension - indicate whether the GLX extension is
          supported


     C SPECIFICATION
          Bool glXQueryExtension( Display *dpy,
                                  int *errorBase,
                                  int *eventBase )

The Lisp code does not ever try to build things like the *dpy parameter from
scratch.  Instead it gets these from calling other GL functions which return
a pointer to a properly constructed struct of type Display.  

The problem I see is that I'm not sure how to do this with
def-alien-routine:

(alien:def-alien-routine ( glxqueryextension "glXQueryExtension" )
c-call:unsigned-int
        ( dpy c-call:integer :out )  ;; try to wedge in a generic integer
pointer, doesn't work
        ( errorBase c-call:integer :out )
      ( errorBase c-call:integer :out )

And using something like '(alien:* T) is not compatible with :out style
arguments.

What is the right way to do this?  I'd love to see an example.

Thanks!

--Andrew



Reply via email to