I'm trying to rename some functions in Lua so I can call them more easily.
For example, of.getHours() function should be able to be called by ofGetHours().
So after initializing the Lua state, I loaded a Lua string which assigns these global function variables like the following:
luaL_dostring(L, "ofGetHours = of.getHours ofGetMinutes = of.getMinutes");
This method works fine but I would like to do this using the Lua C API to increase the performance and make my code more readable.
I think I need to use lua_setglobal() but I don't know how to properly do it. Any help would be greatly appreciated.