How to map newLisp datatypes in C
Posted: Sun Jan 04, 2009 2:15 pm
Hello,
I'm using the following code to "map" (callback fashion) some PureBasic functions in newLisp.
For example:
My problem is I cannot realize a similar thing passing FLOAT as function parameters (d4CreateCube).
Using string or LONG everything works, but with float... my program crashes.
I want to make a PB function as...
Even if I talk about PureBasic I can get examples/hints with standard C types :-)
Thank you!
Thank you!
I'm using the following code to "map" (callback fashion) some PureBasic functions in newLisp.
For example:
Code: Select all
Procedure.s d4CreateCube(argSize.s, argPosX.s, argPosY.s, argPosZ.s)
... do something ...
EndProcedure
(set 'create-cube dummy1)
(cpymem (pack {ld} 265) (first (dump create-cube)) 4)
(cpymem (pack {ld} @create-cubeADDR) (+ (first (dump create-cube)) 12) 4)
(cpymem (pack {ld} {create-cube}) (+ (first (dump create-cube)) 8) 4)
Using string or LONG everything works, but with float... my program crashes.
I want to make a PB function as...
Code: Select all
Procedure.s d4CreateCube(argSize.f, argPosX.f, argPosY.f, argPosZ.f)
... do something ...
EndProcedure
Thank you!
Thank you!