Replies: 1 comment 4 replies
-
I'm trying to embed Lua into an emulator that I'm working on, and I'm running into the exact same issue. Is there any chance that you've resolved this? I can't seem to find any documentation discussing how this should be done, or find anything similar being done in examples. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a struct passed to Lua as userdata. It has a field that is also returned to lua as userdata. That field has a method that mutates it's self. When the method on it is used, it is not modify the field in the "root" userdata like I expected. Here's some code that would show what I mean:
The above code prints the original value, the transform is not modified. In the below code, the transform is modified:
I believe that its because I'm using
add_field_method_get
in theUserData
trait impl ofCamera
to add a field to gettransform
. In the method, I copyTransform
before returning it to Lua. How could I return a reference?Beta Was this translation helpful? Give feedback.
All reactions