lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello
 
I've recently implemented lua into my 3d engine without any bother.  In fact it couldn't have been easier.  I'm a little stuck when it comes to userdata though.
 
Say I have a structure like...
 
typedef struct
{
    int plop;
}Foo, *lpFoo;
 
And then i have some c code like...
 
Foo bar;
 
MyFunction( &bar );
 
And I'd like my lua script to be as close to this as possible.  I'm guessing I have to user the userdata type but I'm struggling to work out how.  Is there a way to do this?  Is there a tutorial on using userdata?  I can't find one specific to it.
 
Thanks
 
scott