auto raw = static_cast<void*>(itemPtr); // 0x0000022382deb400 LuaRef ref(L, itemPtr);
ref.push();
auto ptr = *static_cast<void* const*>(lua_topointer(L, -1)); // 0x00007ff63c8d6e58 ❌sol::stack::push(L, itemPtr);
auto object = sol::stack::pop<sol::object>(L);
auto ptr = *static_cast<void* const*>(object.pointer()); // 0x0000022382deb400 ✅This is needed when the real type of an object is unknown |
Answered by
kunitoki
Jul 16, 2026
Replies: 3 comments 2 replies
|
How are you registering your type ? Is this a class ? |
1 reply
|
I'm adding LuaRef::getPointer able to return the inner pointer to a userdata |
0 replies
1 reply
Answer selected by
3lyrion
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#259