Calling a Lua function from C is fairly straight forward but is there a way to store a Lua function somewhere for later use? I want to store user defined Lua functions passed to my C function for use on events, similar to how the Connect function works in wxLua.
Share
check the registry (
luaL_ref()). it manages a simple table that lets you store any Lua value (like the function), and refer to it from C by a simple integer.