Eduardo Cavazos wrote:

So... do you think chicken can support the bytevectors api? :-)

Hmmm... After poking around some, I see that I can probably cook up a compatability layer. Something along these lines:

----------------------------------------------------------------------
(use srfi-4)

(define (make-bytevector n) (make-blob n))

(define (bytevector-ieee-double-native-ref blob i)

  (f64vector-ref (blob->f64vector/shared blob) i))

(define (bytevector-ieee-double-native-set! blob i val)

  (f64vector-set! (blob->f64vector/shared blob) i val))
----------------------------------------------------------------------

Hopefully somebody can advise on the most efficient approach.

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?

Ed


_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to