lua-users home
lua-l archive

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


> We implemented this same thing almost exactly. It was quite useful to get
> from a lua_State * to a pointer for our C++ wrapper class. I've heard that
> Lua 4.1 has some macros to make this easier, but I have not really
> investigated.
>
> Eric

When I had to do a similar thing, I cheated and just dropped a userdata that
was the 'this' pointer of the enclosing class into a global __SYSTEM table
in the lua state. Cheap, but it worked!

--James Hearn