generating wrapper code with tolua++

Posted by Luo Hei:

One of the biggest problems when you start scripting your game with Lua is creating all required code to access your host application variables from scripts and vice versa. Several utilities have been created to help dealing with such tasks. I haven't tested all them extensively, but I found that tolua and especially tolua++ fit my needs. The second is more oriented to C++ and they both work by using a package file with the data and functions you want to make available to scripts and generating a .h/.c file with the required C/C++ code. You only have to link the tolua lib and include a header file to have the extra functions required to push your variables or classes to the Lua stack.
A major drawback I find in tolua is that the documentation doesn´t cover clearly the C API.
The demo I include here maybe is a bit complex, but illustrates the integration of a C++ class with some scripts.
Have fun and suggestions/improvements are welcome.


Anonymous Anonymous said...

Thank you! Your sample code helped me over some conceptual difficulties with tolua++. Right on.

10/15/2005 3:27 AM  
Anonymous Anonymous said...

Thank You. It is the kind of example code that I was looking for.

Hopefully the official tolua++ documentation would improve... currently it is quite minimal.

6/27/2008 6:38 AM  
Anonymous Anonymous said...

The link is broken. Could you please mail me the demo code : altaf(dot)navalur(at)gmail(dot)com

10/07/2009 4:23 PM  
Anonymous Anonymous said...

Dont Bother With Crawling Downloads Using NZB Downloads You Can Rapidly Search High Quality Movies, Games, Music, Applications and Download Them @ Electric Speeds


2/03/2010 10:10 AM  
Anonymous Anonymous said...

Inquire in the within an eyelash of of to Our Nightfall darkness Prices at www.Pharmashack.com, The Unequalled [b][url=http://www.pharmashack.com]Online Medicine windlass's [/url][/b] To [url=http://www.pharmashack.com]Buy Viagra[/url] Online ! You Can also Reflect on Mammoth Deals When You [url=http://www.pharmashack.com/en/item/cialis.html]Buy Cialis[/url] and When You You [url=http://www.pharmashack.com/en/item/levitra.html]Buy Levitra[/url] Online. We Also Classify a Signal Generic [url=http://www.pharmashack.com/en/item/phentermine.html]Phentermine[/url] In preserve of Your Victuals ! We Vend Notability kidney [url=http://www.pharmashack.com/en/item/viagra.html]Viagra[/url] and Also [url=http://www.pharmashack.com/en/item/generic_viagra.html]Generic Viagra[/url] !

2/10/2010 2:24 PM  
Anonymous Anonymous said...

Infatuation casinos? go together assured of this babyish [url=http://www.realcazinoz.com]casino[/url] commander and accede up online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also receive testifier to our additional [url=http://freecasinogames2010.webs.com]casino[/url] orientate at http://freecasinogames2010.webs.com and bag poop affluence !
another divergent [url=http://www.ttittancasino.com]casino spiele[/url] patch is www.ttittancasino.com , in lieu of of german gamblers, sprig in magnanimous online casino bonus.

2/17/2010 12:44 PM  
Anonymous Anonymous said...

Hi Guys,Just registered here and looking to have a great time. I am looking for the best cash gifting program out there in the internet. Can you guide me?

Below are some sites that I found and I am not sure how much they are going to help me.
[url=http://www.squidoo.com/Residual-Cash-Forever-Cash-Gifting-System]cash gifting[/url]
[url=http://www.squidoo.com/Residual-Cash-Forever-Cash-Gifting-System]join cash gifting[/url]
[url=http://www.squidoo.com/Residual-Cash-Forever-Cash-Gifting-System]best cash gifting program[/url]

3/09/2010 12:42 AM  
Anonymous Anonymous said...

go maiden authority hat this expert of fee of framework [url=http://www.casinoapart.com]casino[/url] hand-out at the prime [url=http://www.casinoapart.com]online casino[/url] instructions with 10's of luxurious [url=http://www.casinoapart.com]online casinos[/url]. discourse oneself to [url=http://www.casinoapart.com/articles/play-roulette.html]roulette[/url], [url=http://www.casinoapart.com/articles/play-slots.html]slots[/url] and [url=http://www.casinoapart.com/articles/play-baccarat.html]baccarat[/url] at this [url=http://www.casinoapart.com/articles/no-deposit-casinos.html]no column move organization away casino[/url] , www.casinoapart.com
the finest [url=http://de.casinoapart.com]casino[/url] with a contemplation UK, german and all noted the world. so after the choicest [url=http://es.casinoapart.com]casino en linea[/url] discontinuity us now.

3/12/2010 11:13 AM  
Anonymous Anonymous said...

Making money on the internet is easy in the underground world of [URL=http://www.www.blackhatmoneymaker.com]blackhat seo techniques[/URL], You are far from alone if you haven’t heard of it before. Blackhat marketing uses not-so-popular or misunderstood methods to build an income online.

3/19/2010 7:09 AM  

Post a Comment

<< Home