From 377472a6dd2c9bdff4d5667f5789c49aee2abb4c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 7 Oct 2016 14:43:09 +0200 Subject: Added sol2 header only library as future replacement for luabridge (nw) --- 3rdparty/sol2/examples/basic.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 3rdparty/sol2/examples/basic.cpp (limited to '3rdparty/sol2/examples/basic.cpp') diff --git a/3rdparty/sol2/examples/basic.cpp b/3rdparty/sol2/examples/basic.cpp new file mode 100644 index 00000000000..cf00ee70ab2 --- /dev/null +++ b/3rdparty/sol2/examples/basic.cpp @@ -0,0 +1,19 @@ +#include + +#include + +int main() { + // create an empty lua state + sol::state lua; + + // by default, libraries are not opened + // you can open libraries by using open_libraries + // the libraries reside in the sol::lib enum class + lua.open_libraries(sol::lib::base); + + // call lua code directly + std::cout << "=== basic example ===" << std::endl; + lua.script("print('hello world')"); + + std::cout << std::endl; +} \ No newline at end of file -- cgit v1.2.3-70-g09d2