[cells-devel] Cells: Why am I put in the debugger here ?
Frank Goenninger
frgo at me.com
Wed May 20 21:50:18 UTC 2009
Hello Jakub,
Am 20.05.2009 um 22:24 schrieb Ramarren:
> Hello,
>
> On Wed, May 20, 2009 at 7:43 PM, Frank Goenninger <frgo at me.com> wrote:
>> :foreign-object (c? (progn
>> (when (and (^foreign-object)
>
> I think the problem is here, you have a slot dependent on itself. To
> access slot previous value use .cache symbol macro, like this:
>
> (defmd color ()
> red
> green
> blue
> alpha
> foreign-object
>
> :md-name (gensym "CELLO-COLOR-")
> :red (c-in 0)
> :green (c-in 0)
> :blue (c-in 0)
> :alpha (c-in 0)
> :foreign-object (c? (progn
> (when (and .cache
> (not (null-pointer-p .cache)))
> (foreign-free .cache))
> (let ((fo (foreign-alloc :float :count 4)))
> (when (not (null-pointer-p fo))
> (progn
> (setf (mem-aref fo :float 0)
> (/ (^red) 255.00000000000f0))
> (setf (mem-aref fo :float 1)
> (/ (^green) 255.0000000000f0))
> (setf (mem-aref fo :float 2)
> (/ (^blue) 255.0000000000f0))
> (setf (mem-aref fo :float 3)
> (/ (^alpha)
> 255.0000000000f0))))))))
>
> Regards,
> Jakub Higersberger
Ouch, yes, of course. Thanks!!!
Cheers
Frank
--
Frank Goenninger
Cell: +49 175 4321058
E-Mail: frgo at me.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2227 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cells-devel/attachments/20090520/d1548bd3/attachment.bin>
More information about the cells-devel
mailing list