lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



So right now the consensus for some of you is that due to the various ways of binding classes, methods, arguments, ref-non-ref C++ code makes automatic binding a large hazzle that in the end will just obfuscate the core code that is needed...

I can buy this argument too.

But then, if you have to write all these template instantiations to bind namespaces, classes etc, you will have a dual representation of your classes which is ok if you "own" the project. But now and then you get updates from rendering toolkits and other dependencies, then you sometime have a major task updating the bindings.


In that case, tolua++ give you an alternative to have a similar representation at least.
Updating a class is merely copying a .h file, stripping out info thats not needed and go from there.

However I had problems where I had to add namespaces all over the place.
For example binding osg required in many cases that I had to add namespaces to a lot of the arguments used...

Also getting enums correctly between namespaces/libraries was somewhat of a mess..

I will for now leave the automatic C++-> Lua trail for a while.
If anyone has more ideas feel free to post them.

I think there were a few lua/c++ bindings added in this post...
Is there anyone that can update the page: http://lua-users.org/wiki/BindingCodeToLua


/Anders

On Wed, Jan 21, 2009 at 11:26 AM, Elbers, H.P. <H.P.Elbers@boskalis.nl> wrote:
> From: lua-bounces@bazar2.conectiva.com.br
> [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of
> Jose Luis Hidalgo

> I will try to have a look at cpp2xml, and lqt, and see what
> we can do there.

You might also want to try doxygen to generate info on xml format about
classes (with details about all members)

A minimal config (doxy.cfg, in the directory where the sources are)
might be:

GENERATE_TAGFILE           = tags.xml
EXTRACT_ALL                = YES
RECURSIVE                  = YES

The xml is generated with 'doxygen doyxy.cfg'

h.t.h.
 Hans