¡@

Home 

c++ Programming Glossary: lua_touserdata

Casting between void * and a pointer to member function

http://stackoverflow.com/questions/1307278/casting-between-void-and-a-pointer-to-member-function

void T method int int reinterpret_cast void T int int lua_touserdata L lua_upvalueindex 1 T obj reinterpret_cast T lua_touserdata.. L lua_upvalueindex 1 T obj reinterpret_cast T lua_touserdata L 1 obj method lua_tointeger L 2 lua_tointeger L 3 return 0.. L 3 return 0 For those of you unfamiliar with Lua lua_touserdata L lua_upvalueindex 1 gets the first value associated with a..

Sending variable pointers back and forth between C++ and Lua?

http://stackoverflow.com/questions/3481856/sending-variable-pointers-back-and-forth-between-c-and-lua

C object from that we just de reference the return from lua_touserdata L 1 . int L_print lua_State L person p person lua_touserdata.. L 1 . int L_print lua_State L person p person lua_touserdata L 1 p print return 0 int L_getAge lua_State L person p person.. p print return 0 int L_getAge lua_State L person p person lua_touserdata L 1 lua_pushnumber L p getAge return 1 int L_setAge lua_State..