Trying to make an engine that calls other language from lua code. And the problem that I stuck into is callbacks.
Converting strings, ints and so on is easy, but what to do with functions?
Lua API has lua_isfunction to check that function argument is function, but how do I store it to call it later when called script needs it? There is lua_topointer, that can store function, but I don’t see how to call that stored pointer.