摘要: 在C++中调用lua函数的一般方式如下: 1 void callfunc1(lua_State* L, int arg1, const string& arg2)//调用脚本中的func1函数,参数为一个number,一个string 2 { 3 lua_getglobal(L, "func1"); 4 lua_pushnumber(L, arg1); 5 lua_pushstring(L, arg2.c_str()); 6 lua_pcall(L, 2, LUA_MULTRET, 0); 7 } 8 void callfunc2(lua_Sta... 阅读全文
posted @ 2013-01-08 15:37 愤怒的豆沙包 阅读(367) 评论(0) 推荐(0) 编辑