🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Sharing MultiDim Data Between C++/Lua

Started by
0 comments, last by Dwiel 20 years, 1 month ago
Hello, I am working on using Lua as an interface to my CC/++ code and would like to be able to access a large amount of multidimentionable data in both Lua and C/C++. Having two copies is the very last alternative. I would like to do this while keeping the interface to the data as easy as possible. The only thing I have thought of so far is for the data to be allocated in C and then given Lua functions to acces that data. The functions would be GetDat(string varname, int index) and a simmilar Set. To get into a multi-dim array, multipule set/gets could be used. Is there an easier way to do this? forcing the use of functions in order to access the data makes the lua code much harder to read. It would be nice if I could treat it as a nurmal mulidim lua array while keeping a single copy of the data. I might be able to overload the ()operator for a table that represents that variable and then use that to index into the array, but it gets complex with mulidim arrays. How, if at all, can I simplify this lua/C interface of data? Thanks for the help! Dwiel Go see some hot chicks and vote to see who is hottest: dwiel.no-ip.com [edited by - Tazzel3d on June 7, 2004 5:47:36 PM]
Advertisement
Is there any way I can have a large amount of data that can be accessed directly by lua and C/C++? I am approaching the problem again, and it would be much easier if I could share the memory between the two languages.

Thanks

Go see some hot chicks and vote to see who is hottest: dwiel.no-ip.com

This topic is closed to new replies.

Advertisement