// shows how to load basic data to a struct #include #include #include struct config { std::string name; int width; int height; void print() { std::cout << "Name: " << name << '\n' << "Width: " << width << '\n' << "Height: " << height << '\n'; } }; int main() { sol::state lua; config screen; lua.open_file("config.lua"); screen.name = lua.get("name"); screen.width = lua.get("width"); screen.height = lua.get("height"); screen.print(); }