chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Re: bytevectors


From: Eduardo Cavazos
Subject: [Chicken-users] Re: bytevectors
Date: Tue, 17 Feb 2009 09:31:31 -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:

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




reply via email to

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