Pass a LuaFunction back to c++ and call it later...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Pass a LuaFunction back to c++ and call it later...

Wolfmanfx
Hi,

I have a question:

I want to register a lua function to c++ so i assume the c++ function must take a luabind:object* ?
Further how do i call the function (luabind::call<luabind:object>)?
When i register the function in c++ is the ref count incremented from the table, which the table belongs?

best regards Murat
Reply | Threaded
Open this post in threaded view
|

Re: Pass a LuaFunction back to c++ and call it later...

Wolfmanfx
luabind::call_function<void>(luaBindObject["FuncName"], boost::ref(luaBindObject), param1, param2...);

I just did not passed the self object (boost::ref(luaBindObject))

Now it works
Wolfmanfx wrote
Hi,

I have a question:

I want to register a lua function to c++ so i assume the c++ function must take a luabind:object* ?
Further how do i call the function (luabind::call<luabind:object>)?
When i register the function in c++ is the ref count incremented from the table, which the table belongs?

best regards Murat