Passing table with subtable to Lua function from C++
问题 I'm trying to pass table with subtable to Lua function as argument from C++. Here's my code that doesn't work but shows what I'm trying to do. class DragInfo{ public: std::vector <std::string> files; glm::vec2 position; }; //a callback that passes DragInfo to a Lua function as a table which has 2 subtables void callDragged(DragInfo &info) { lua_getglobal(L, "dragged"); if (!lua_isfunction(L, -1)) { lua_pop(L, 1); return; } lua_newtable(L); for (size_t i = 0; i < info.files.size(); ++i) { lua