chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Passing blobs to glGetDoublev in (hacked) OpenGL egg


From: Eduardo Cavazos
Subject: [Chicken-users] Passing blobs to glGetDoublev in (hacked) OpenGL egg
Date: Mon, 23 Feb 2009 23:58:59 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080716 SeaMonkey/1.1.11

Eduardo Cavazos wrote:

Let's suppose I take this approach, where I use Chicken blobs in place of R6RS bytevectors. There's one problem that exists. Some of the procedures in the OpenGL egg want f64vector objects. For example, this results in an error:

(let ((bv (make-blob (* 16 8))))
  (glGetDoublev GL_MODELVIEW_MATRIX bv)
  bv)

Again for comparison, the OpenGL libraries in Larceny, Ypsilon, and Ikarus allow a bytevector to be passed to 'glGetDoublev'.

I'm willing to use a customized gl egg for my purposes. This is from 'gl.scm' in the opengl egg:

    void  glGetDoublev( GLenum pname, GLdouble *params );

What could I change that to such that blobs are allowed as the second argument?

OK, here's what I came up with. The opengl egg uses easyffi. So the line for 'glGetDoublev' is:

    void  glGetDoublev( GLenum pname, GLdouble *params );

Again, my goal here is to be able to pass a blob as the second argument. By using 'foreign-lambda' directly, I was able to get it to work:

    (define glGetDoublev
      (foreign-lambda void glGetDoublev unsigned-integer blob))

So my question is, how can I express that in easyffi? I.e. I'd like to be able to have something like:

    void  glGetDoublev( GLenum pname, blob params );

I'm guessing something involving the ___declare( type , ... ) form.

Ed




reply via email to

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