Interpreter.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef ROCKETCORELUAINTERPRETER_H
  2. #define ROCKETCORELUALUATYPE_H
  3. /*
  4. This initializes the lua interpreter, and has functions to load the scripts
  5. A glorified namespace, but I want the lua_State to be unchangeable
  6. */
  7. #include <Rocket/Core/Lua/lua.hpp>
  8. #include <Rocket/Core/Plugin.h>
  9. namespace Rocket {
  10. namespace Core {
  11. namespace Lua {
  12. class Interpreter : public Plugin
  13. {
  14. public:
  15. static void LoadFile(const Rocket::Core::String& file);
  16. static void DoString(const Rocket::Core::String& str);
  17. static void Report();
  18. static void BeginCall(int funRef);
  19. static bool ExecuteCall(int params = 0, int res = 0);
  20. static void EndCall(int res = 0);
  21. static lua_State* GetLuaState();
  22. //From Plugin
  23. virtual int GetEventClasses();
  24. virtual void OnInitialise();
  25. virtual void OnShutdown();
  26. private:
  27. //This will populate the global Lua table with all of the Lua types and some global functions
  28. static inline void RegisterEverything(lua_State* L);
  29. void Startup();
  30. static lua_State* _L;
  31. };
  32. }
  33. }
  34. }
  35. #endif