Jump to content
  • Advertisement
Sign in to follow this  

best way to integrate Lua with c++

This topic is 4770 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Another quick q :) What do most people use to automate bind functions? tolua++, luabind, etc? what arethe pros and cons of each binding library? Thanks!

Share this post

Link to post
Share on other sites
Currently I'm experimenting with Lunar (http://lua-users.org/wiki/SimplerCppBinding) to bind my C++ classes to Lua. It uses a simple template to allow you to choose which member functions to expose, and allows you to choose the 'class name' which is used in Lua. After registering the class with Lua, you can then do things in Lua like:

MyButton = Button("Test",x,y,width,height)

function Button:OnAction()
printf("User clicked button %s", self.GetCaption())

Most likely, you'd want to write a wrapper-class which acts as an interface between Lua and the actual instance of your class.

Share this post

Link to post
Share on other sites
LuaPlus + LuaBind.

- Clean binding from script->C++ (including oop)
- pretty crash-resistant

- Unicode
- Script debugging marginally easier from plugins
- handles all the messy stack-handling stuff

Wouldn't go back to pure LUA for love or money.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!