summaryrefslogtreecommitdiff
path: root/source/libs/asura-lib-utils/scripting/lua_env.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/libs/asura-lib-utils/scripting/lua_env.h')
-rw-r--r--source/libs/asura-lib-utils/scripting/lua_env.h72
1 files changed, 0 insertions, 72 deletions
diff --git a/source/libs/asura-lib-utils/scripting/lua_env.h b/source/libs/asura-lib-utils/scripting/lua_env.h
deleted file mode 100644
index e2fc4fc..0000000
--- a/source/libs/asura-lib-utils/scripting/lua_env.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef __ASURA_LUA_ENV_H__
-#define __ASURA_LUA_ENV_H__
-
-extern "C"
-{
-#include <Lua51/lua.h>
-#include <Lua51/lauxlib.h>
-}
-#include <Luax/luax.h>
-
-#include "../singleton.hpp"
-
-namespace AsuraEngine
-{
- namespace Scripting
- {
-
- ///
- /// ͨӿڷlua stateAsura˼ǣ߳άһluaӦ
- /// Ҫ߼ڴlua߳߽ջ
- ///
- class LuaEnv ASURA_FINAL : public Singleton<LuaEnv>
- {
- public:
-
- LuaEnv() : mVM(0) {};
- ~LuaEnv() {};
-
- ///
- /// ִջ
- ///
- inline void Init()
- {
- ASSERT(!mVM);
- mVM = new Luax::LuaxVM();
- ASSERT(mVM);
- mVM->Setup();
- };
-
- inline lua_State* GetMainThread()
- {
- return mVM->GetMainThread();
- };
-
- inline void Exit()
- {
- delete mVM;
- mVM = nullptr;
- }
-
- private:
-
- ///
- /// ̱߳һluaһAsuraԶֻһ󲿷ִ붼
- /// УֻһΡ߳\ִջӦglobal_Stateģ
- ///
- /// struct lua_State *mainthread;
- ///
- /// ʹlua_newstate()ᴴһһglobal_Stateṹһ
- /// ߳lua_Stateءglobal_State̹߳˵һ
- /// ߳lua_newstate()⣬߳lua_newthread()
- ///
- Luax::LuaxVM* mVM;
-
- };
-
- }
-}
-
-namespace AEScripting = AsuraEngine::Scripting;
-
-#endif \ No newline at end of file