diff --git a/src/core/context.hpp b/src/core/include/pw/core/context.hpp similarity index 100% rename from src/core/context.hpp rename to src/core/include/pw/core/context.hpp diff --git a/src/core/core.hpp b/src/core/include/pw/core/core.hpp similarity index 100% rename from src/core/core.hpp rename to src/core/include/pw/core/core.hpp diff --git a/src/core/include/pw/core/script.hpp b/src/core/include/pw/core/script.hpp new file mode 100644 index 0000000..711da29 --- /dev/null +++ b/src/core/include/pw/core/script.hpp @@ -0,0 +1,51 @@ +#ifndef PW_SCRIPT_HPP +#define PW_SCRIPT_HPP + +#include +#include + + +#include + + +namespace pw { + + +class script; + +class main_loop { + + script &_s; + bool _stop = false; + + main_loop(script& s); + +}; + +class script { +protected: + + scripting::state _lua; + +public: + + script(); + ~script(); + + bool update(); + + bool load(const std::string &s); + + int run(const std::string& s); + + void load(sol::table &ns); + + friend class main_loop; + +}; + +} + + + +#endif diff --git a/src/core/include/pw/core/scripting.hpp b/src/core/include/pw/core/scripting.hpp new file mode 100644 index 0000000..68c8947 --- /dev/null +++ b/src/core/include/pw/core/scripting.hpp @@ -0,0 +1,13 @@ +#ifndef PW_SCRIPTING_HPP +#define PW_SCRIPTING_HPP + +#include "sol.hpp" + +namespace pw { + +// include external namespace of sol +namespace scripting = sol; + +} + +#endif diff --git a/src/core/window.hpp b/src/core/include/pw/core/window.hpp similarity index 99% rename from src/core/window.hpp rename to src/core/include/pw/core/window.hpp index 89dcc07..1415ede 100644 --- a/src/core/window.hpp +++ b/src/core/include/pw/core/window.hpp @@ -27,7 +27,6 @@ public: window(); ~window(); - bool update(); void set_title(const char* t); diff --git a/src/core/script.hpp b/src/core/script.hpp deleted file mode 100644 index a369a5c..0000000 --- a/src/core/script.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef PW_SCRIPT_HPP -#define PW_SCRIPT_HPP - -#include -#include -#include - -namespace pw { - -class script { - - sol::state _lua; - -public: - - script(); - ~script(); - - bool update(); - - void run(const char* s); - -}; - -} - - - -#endif diff --git a/src/core/context.cpp b/src/core/src/context.cpp similarity index 100% rename from src/core/context.cpp rename to src/core/src/context.cpp diff --git a/src/core/core.cpp b/src/core/src/core.cpp similarity index 100% rename from src/core/core.cpp rename to src/core/src/core.cpp diff --git a/src/core/script.cpp b/src/core/src/script.cpp similarity index 100% rename from src/core/script.cpp rename to src/core/src/script.cpp diff --git a/src/core/window.cpp b/src/core/src/window.cpp similarity index 100% rename from src/core/window.cpp rename to src/core/src/window.cpp