LuaYard/LuaYard.cpp
Kiritow bc189b4951 完整重构
分离各SDL类的包装代码.
事件分发处理全部转移至Lua Init层. C层只提供获取事件的方法.
这样有助于提高性能,以及今后Coroutine scheduler的添加.
2019-08-25 00:09:28 +08:00

24 lines
394 B
C++

#include <iostream>
#include <string>
#include "LuaEngine.h"
using namespace std;
int main()
{
InitEngine();
do {
LuaVM L;
InitLibs(L);
cout << "<ENGINE> Started." << endl;
if (luaL_dofile(L, "code/init.lua"))
{
cout << "<ENGINE FATAL ERROR> " << lua_tostring(L, -1) << endl;
}
else
{
cout << "<ENGINE> Stopped normally." << endl;
}
} while (0);
StopEngine();
}