【文件属性】:
文件名称:libscript_lua:简单的 Lua C++ 绑定
文件大小:233KB
文件格式:ZIP
更新时间:2021-06-18 00:12:15
C++
简单的 Lua C++11 绑定
使用起来很简单,比如:
#include "libscript.h"
int main()
{
Script script;
script.execString("print(\"hello world\")");
}
使用函数和闭包
#include "libscript.h"
void foo(const char* s)
{
std::cout << "This is foo" << std::endl;
}
int foo2(RawInterface raw)
{
UpValue v(raw, 1);
std::cout << v.toInteger() << std::endl;
v.reset(v.toInteger() + 1);
return 0;
}
int main()
{