Pierce: I already see the repo, i kwnow now the difference and is not the problem i have now. I made the suggestion for book draft i found, because theres is no example on it. Thanks for answer. Stephan : Yes, as Esteban said i´m using that, I´m extending (or trying) Esteban´s project. And i´m having the problem that esteban metioned. Thanks for answer. Ben: I have in C the same example as in Pharo using the physics of CHipmunk, and in C is working fine, there is a problem in the call to the function from Pharo in 64 bits. Thanks for answer. 2017-09-17 12:11 GMT-03:00 Ben Coman <btc@openinworld.com>:
On Fri, Sep 15, 2017 at 9:42 PM, alvaro piorno <alvaropiorno100@gmail.com> wrote:
Hi everybody, i´m using UnifiedFFI with Chipmunk2D library . I want to get a pointer to a C Structure (cpBody) and set a position to it. I have a subClass of FFIOpaqueObject to handle pointer.
This is the "new " ffiCall : self ffiCall: #(cpBody* cpBodyNew(cpFloat m, cpFloat i))
And this is a "seter" ffiCall:
self ffiCall: #( void cpBodySetPosition( self, cpVect vector ) ).
I`m not getting any "error" but the position is not updating. I tried the same using Chipmunk directly and it works, so there is a problem with what i have in Pharo.
A general approach might be to write your own C wrapper around Chipmunk library functions which just does a debug printout of parameters before calling the wrapped function. Use these for both from Pharo and your "direct" trial, and see how they compare.
cheers -ben