chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Passing blobs to glGetDoublev in (hacked) OpenGL eg


From: Jim Ursetto
Subject: Re: [Chicken-users] Passing blobs to glGetDoublev in (hacked) OpenGL egg
Date: Tue, 24 Feb 2009 02:24:28 -0600

On Mon, Feb 23, 2009 at 11:58 PM, Eduardo Cavazos
<address@hidden> wrote:
>> What could I change that to such that blobs are allowed as the second
>> argument?

void  glGetDoublev( GLenum pname, ___byte_vector params );

(The egg should probably be updated to replace or alias ___blob to
___byte_vector...)

Note: you will receive an incompatible type warning as Chicken will
attempt to pass a char* (the blob) to a function expecting double*
without a cast.  In practice that should not cause a problem.

You could instead use blob->f64vector/shared, in which case your
example becomes:

(let ((bv (make-blob (* 16 8))))
  (glGetDoublev GL_MODELVIEW_MATRIX (blob->f64vector/shared bv))
  bv)

I am not sure if you can declare a foreign type transformation on
GLdouble* to perform this conversion automatically (nor whether that
would be a good idea).  You could write wrappers to do this though.
Once you get to that point, though, your original method starts to
look more attractive...




reply via email to

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