10-14-2013, 06:28 AM
Depends, mostly on what the function params and return values are. If they're simple, like strings, numbers or class objects, then it's simple; if it's objects that Lua expresses as tables or callbacks, then it's a nightmare 
For the simple case, have a look at BlockID.h / .cpp, function BlockStringToType() . It is declared in the header inside a // tolua_begin and //tolua_end comment blocks, so the tolua parser will export it automagically. Then the function body is simply in BlockID.cpp as normal code. That's all there is - just wrapping the declaration in the tolua_* comments.
For the difficult case, you need to implement your functions and then write something colossal like there is in ManualBindings.cpp - those are the bindings for the difficult functions. You can try doing that, or simply ask, if it's good enough an idea, someone else here might write it for you

For the simple case, have a look at BlockID.h / .cpp, function BlockStringToType() . It is declared in the header inside a // tolua_begin and //tolua_end comment blocks, so the tolua parser will export it automagically. Then the function body is simply in BlockID.cpp as normal code. That's all there is - just wrapping the declaration in the tolua_* comments.
For the difficult case, you need to implement your functions and then write something colossal like there is in ManualBindings.cpp - those are the bindings for the difficult functions. You can try doing that, or simply ask, if it's good enough an idea, someone else here might write it for you
