Sign in to follow this  
sp00n

best way to integrate Lua with c++

Recommended Posts

sp00n    122
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
swordfish    276
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())
end

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
__ODIN__    479
LuaPlus + LuaBind.

Benefits:
[luabind]
- Clean binding from script->C++ (including oop)
- pretty crash-resistant

[luaplus]
- 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.

Allan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this