You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm binding a method, that returns a pointer to an object. I have to call a function on this object in Lua. Is it possible to work with the pointer like the way you do it in C++? pointer->getSomething()
Or can I specify the return type of the method, so that it returns the object itself directly instead of the pointer?
I tried this in Lua: pointer = SomeObject:getInstance() pointer.getSomething()
But the Lua output is this: expected userdata, got no value
If I print the pointer, it says: userdata: 0x7f5d38003da8
The binding of the C++-Object: LuaIntf::LuaBinding(state).beginClass<SomeObject>("SomeObject") .addStaticFunction("getInstance", &SomeObject::getInstance) .addFunction("getSomething", &SomeObject::getSomething)
Thanks!
The text was updated successfully, but these errors were encountered:
I'm binding a method, that returns a pointer to an object. I have to call a function on this object in Lua. Is it possible to work with the pointer like the way you do it in C++?
pointer->getSomething()
Or can I specify the return type of the method, so that it returns the object itself directly instead of the pointer?
I tried this in Lua:
pointer = SomeObject:getInstance()
pointer.getSomething()
But the Lua output is this:
expected userdata, got no value
If I print the pointer, it says:
userdata: 0x7f5d38003da8
The binding of the C++-Object:
LuaIntf::LuaBinding(state).beginClass<SomeObject>("SomeObject")
.addStaticFunction("getInstance", &SomeObject::getInstance)
.addFunction("getSomething", &SomeObject::getSomething)
Thanks!
The text was updated successfully, but these errors were encountered: