diff options
author | chai <chaifix@163.com> | 2018-11-16 00:24:51 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-11-16 00:24:51 +0800 |
commit | 831e814ce9bdb84e86c06c4a52008f6bdaaa00d6 (patch) | |
tree | f91fccc7d2628d6e0a39886134b2bb174f5eede4 /src/lua/main.cpp | |
parent | 6dc75930fe5fe02f1af5489917752d315cf9e48f (diff) |
*合并master到minimal分支
Diffstat (limited to 'src/lua/main.cpp')
-rw-r--r-- | src/lua/main.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/lua/main.cpp b/src/lua/main.cpp deleted file mode 100644 index 95862ec..0000000 --- a/src/lua/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#ifdef _WIN32 - #include <SDL2/SDL_Main.h> - #include <direct.h> -#endif - -#include "luax.h" -#include "jin.h" -#include "libjin/jin.h" -#include <Windows.h> - -using namespace JinEngine::Lua; -using namespace JinEngine::Filesystem; - -int main(int argc, char* argv[]) -{ - lua_State* L = luax_newstate(); - - /* open lua standard module */ - luax_openlibs(L); - /* open jin module */ - luaopen_jin(L); - /* add args to field */ - luax_newtable(L); - for (int i = 0; i < argc; ++i) - luax_setrawstring(L, -2, i + 1, argv[i]); - luax_setfield(L, -2, "args"); - /* push current working directory */ - /* absolute directory */ - Buffer cwd = Buffer(1024); -#ifdef _WIN32 - _getcwd((char*)&cwd, cwd.size()); -#elif defined __unix__ -#elif defined __APPLE__ -#endif - luax_setfieldstring(L, "cwd", (char*)&cwd); - luax_clear(L); - - /* boot jin and run it */ - boot(L); - - luax_close(L); - - return 0; -}
\ No newline at end of file |