Thanks for the suggestion, but I am already using SWIG in the embedded project I am working on. I chose Swig as it had the advantage of not having any Windows dependencies, so it was pretty easy to use in an embedded environment. I have found it has some limitations, for example as far as I can see it cannot really handle arrays of data, hence my question here.
Besides, I wanted to gain an understanding of the Lua C API, so I was happy to go with a hybrid approach, SWIG for some bindings and manuallly written binding code for some of the things that SWIG didnt handle. So far its working out well, and its easy to mix and match SWIG bound code and manual code.
I just need to figure out this userdata stuff as it is obviously pretty important in getting a good handle on understanding the Lua/C API. Pity I dont think I can use the light userdata as I now understand that sufficiently. I wonder if anyone has got time to post a full user data example to contrast with the light userdata example earlier in this thread ? I am sure it would help other folks in the future apart from just me !
Date: Sun, 28 Aug 2011 16:46:35 -0400
Subject: Re: Struggling with userdata concepts
Have you considered using SWIG? It generates all that code for you. AND allows you to export your C++ to several other languages without extra coding. Why would you ever want to do that? For instance, you have a C++ library, that you want to use from a C# GUI. In addition, that GUI is scriptable in Lua, so you export parts of the C++ lib to Lua. One SWIG interface definintion file exports to both Lua and C#. Crazy awesome.
On Sat, Aug 27, 2011 at 10:46 AM, Jeff Smith <email@example.com> wrote: