Perhaps I misunderstand their use or read the documentation incorrectly, but how do I access members of a structure or class passed to Lua as light user data? For example, if a vector using the following structure
typedef struct Foo { int x; int y; } Foo;
was declared as a βtestβ and defined as something like x = 413 and y = 612 and pressed with a call
lua_pushlightuserdata( L, (void *) &test ) ;
What would the Lua code of a function look like that manipulates or prints x and y?
c ++ lua lua-userdata
Lucas
source share