lua-users home
lua-l archive

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


Quoth Christopher Eykamp <chris@eykamp.com>, 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
http://lua-users.org/wiki/CppBindingWithLunar.

>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