GLBasic forum

Feature request => IDE/Syntax => Topic started by: bigsofty on 2010-Oct-20

Title: IMPORT extended a little
Post by: bigsofty on 2010-Oct-20
Hi,

I love using IMPORT as opposed to INLINE, its very clean looking and its shortened my code no end. One thing I have trouble with is importing arrays though.

This for example does not work...

Code (glbasic) Select
IMPORT "C" int CreatePolygon2DShape(float* points, int count, float mass)

It would be great if array pointers could be added to the supported IMPORT types?

Cheers,


Ian
Title: Re: IMPORT extended a little
Post by: Kitty Hello on 2010-Oct-20
not possible. I have no idea how to wrap them and you must have some memory allocated and stuff.
A float* is not represent, anyway. On win32 it's "double". You'll need an inline wrapper here.
Title: Re: IMPORT extended a little
Post by: bigsofty on 2010-Oct-20
OK, that sounds pretty conclusive, I'll go for the INLINE option.

Cheers,


Ian