[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Converting lightuserdata to self
- From: Christopher Eykamp <chris@...>
- Date: Mon, 22 Feb 2010 02:33:05 -0800
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?