[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lunar - how to modify it to give lua an already created c++ object
- From: Giuliano Suminsky <yksnimus@...>
- Date: Sat, 10 Nov 2012 23:05:08 -0200
HiMy understanding of what Lunar does is that it allows objects to be created on lua scripts.
How can I modify/use it so that I can give a lua script an existing/living c++ object?
class Agent{
static const char className[];
static Lunar<LuaAIAgent>::RegType methods[];
...exposed methods
void InitLuaScript( const char * szLuaScriptFilename_p ){
m_pLua = lua_open();
luaL_openlibs(m_pLua);
Lunar<LuaAIAgent>::Register( m_pLua );
// give this object to lua script
}
}
See, instead of giving a type that lua can use to create objects, I want to give an object already created on c++
What I need is methods called from lua able to modify the c++ object.