[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: The current state of interfacing Lua with C++ code
- From: Carsten Fuchs <CarstenFuchs@...>
- Date: Wed, 09 Dec 2009 11:41:15 +0100
Hi Martin,
Martin C. Martin schrieb:
What libraries would someone recommend for binding Lua to parts of a
large, existing C++ code base? It needs to work in both Windows and
Linux. I'm looking at LuaPlus (I know, it's a lot more than just a C++
binding), but perhaps that's not the place to start?
When I started binding Lua to my C++ code in the Cafu game engine <http://www.cafu.de>, my goals
were to keep everything as straightforward and with as few additional layers of code as
possible, and thus, although I looked into them, I never used any of the available C++-binding
libraries, but just the techniques explained in the PiL2 book.
While this route certainly takes longer in order to see the first results and in fact may seem
cumbersome in a sense (yes, you start thinking about putting the resulting code into a library
of your own... which in a sense means re-inventing the wheel), I still found the results
worthwhile: My code is very short, clean, and I fully understand all the details both on the Lua
and on the C++ side. :-) (And I thoroughly learned Lua and its C API this way.)
So my recommendation is to start with the PiL2 book, and only turn to the libraries if you
cannot or don't want to take the "hand-made" approach.
Best regards,
Carsten
--
Cafu - The Game and Graphics Engine for
multiplayer, cross-platform, real-time 3D Action
Learn more at www.cafu.de
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature