I'm attempting to get the pointer of C++ object created in Lua.
This is Lua script example:
objecttest = Image("file.png")
How I get this object pointer in C++:
Image* image = NULL;
lua_getglobal(L, "objecttest");
if (lua_isuserdata(L, -1))
image = LuaIntf::CppObject::get<Image>(L, -1, false);
Is this the best way? Or is there any way to get this with LuaRef?
Thanks!