Created
August 23, 2012 20:31
-
-
Save Twinklebear/3441305 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | |
| ]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)) | |
| ]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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