Currently, in my engine, I'm simply passing lua_State* to subsystems and directly calling Lua API functions.
How do other engines usually handle scripting?
Writing a "low level" wrapper like:
int Script::getTableField(const char* key, int& out)
{
lua_getfield(_lua_state, -1, key);
if(!lua_isnumber(_lua_state, -1)
return 0;
out = lua_tointeger(_lua_state, -1);
return 1;
}
Seems a bit pointless, and would probably reduce flexibility...
I feel like it might be better to simply use the Lua API in the engine subsytems and only provide high-level functions to the gameplay code.
Any thoughts?