lua-users home
lua-l archive

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

On 2/22/2010 3:03 AM, Drake Wilson wrote:
Quoth Christopher Eykamp<>, on 2010-02-22 02:33:05 -0800:
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.
First hit for "lunar lua c++" on the Web shows up as

> From that:
| lunar.h has two extra public methods: push and call.
| push receives a pointer to an object and pushes a unique [1] userdata
| onto the stack, and returns the stack index of this userdata. An
| optional second parameter specifies whether or not to delete the
| object when the userdata gc event occurs. The default for this
| parameter is false which means the object won't be deleted.

Is that not working for you for some reason?

    --->  Drake Wilson
Yes, I think that will work. My main problem was that it wasn't listed in the PiL index :-)

Thanks for your help!