lua-users home
lua-l archive

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

I'm just going to apologize up front for my lack of eloquence on this question. I understand what I need to know, but am not sure I can articulate it clearly.

I am developing a Lua event handling framework loosely based on the Lua Gems sample. The main game is in C++, and I am tying them together with Lunar. My problem is I need some way to pass a "self" object from C++ to my Lua code. I can pass a lightuserdata, but since that is just a pointer, Lua can't do much with it besides call C++ functions. I do not know how to get a real, operable Lua reference to my object.

What can I pass from C++ that Lua will see as a "self" type of object, and that, from within Lua, I can call Lua methods on?