Skip to content

Instantly share code, notes, and snippets.

@Twinklebear
Created August 23, 2012 20:31
Show Gist options
  • Select an option

  • Save Twinklebear/3441305 to your computer and use it in GitHub Desktop.

Select an option

Save Twinklebear/3441305 to your computer and use it in GitHub Desktop.
void Object::RegisterLua(lua_State *l){
using namespace luabind;
module(l, "Game")[
class_<Object>("Object")
.def("Show", (void(Object::*)(int))&Object::Show)
.def("Show", (void(Object::*)(std::string))&Object::Show)
];
}
void Object::Show(int v){
std::cout << "Some integer: " << v << std::endl;
}
void Object::Show(std::string s){
std::cout << "Some string: " << s << std::endl;
}
void Object::RegisterLua(lua_State *l){
using namespace luabind;
module(l, "Game")[
class_<Object>("Object")
.def("Show", (void(Object::*)(int)&Object::Show))
.def("Show", (void(Object::*)(std::string)&Object::Show))
];
}
void Show(int v);
void Show(std::string s);
///Register the object's lua module
static void RegisterLua(lua_State *l);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment