[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: toLua & arrays
- From: Ariel Manzur <listas@...>
- Date: Wed, 9 Nov 2005 20:06:30 -0500
On Sat, Nov 05, 2005 at 02:50:50PM +0100, Markus Fritsche wrote:
> Hi!
>
> I successfully create a wrapper with tolua for an api. There's only one
> function where it doesn't work as expected:
>
> MystType ValArray(hType hPool, MystType * InitArray, int MaxSize );
Which one is the array here? tolua will only see a pointer to MystType on
that definition.. you could do something like:
MystType ValArray(hType hPool, MystType InitArray[N], int MaxSize );
where 'N' is the (static) size of the array.. You can also have an object
with an operator[].. But you won't be able to use the pointer as an array
from lua, because pointers are passed to lua as references to the object
they point to.
> Do I have to build an own wrapper by hand for this one?
most likely, yes..
Ariel.