Jump to content
  • Advertisement
Sign in to follow this  

Lua Userdata

This topic is 4413 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my application I have a script that has a function that calls an object factory and tells it to create objects. Only problem is once the object is created I am having trouble returning it to the script, heres the function DataType* To_Create = new DataType; lua_pushlightuserdata(gScript,(void*)To_Create); lua_setglobal(gScript, "Generic_Data"); Later I pass this data via script into another c++ function where Add_Data represents a c++ function that takes a void pointer and converts it to the appropriate data. Add_Data(Generic_Data) All of this seems right to me but its not working. Generic data s making it from one side to the other. Anyone who has an experience with this I would appreciate the input. Thanks for your time

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!