I am having some trouble calling Lua functions from C++ using LuaBridge. The idea is that I want to call "Update" on the script on every game update in C++. The following code is what I have <a href="https://eliasdaler.wordpress.com/2014/07/18/using-lua-with-cpp-luabridge/" rel="nofollow">found online</a>:
So in my case this would be:
However, the
does not seem to exist in LuaBridge 2.0 (
namespace). This is different from the
I am wondering if this has been replaced by a different function call or if it has been deprecated out of the 2.0 version. I can of course use the normal C Lua approach, but I was wondering if this has been abstracted in LuaBridge (to make things easier)
Code:
LuaRef sumNumbers = getGlobal(L, "sumNumbers");
int result = sumNumbers(5, 4);
So in my case this would be:
Code:
LuaRef updateFunction = getGlobal(L, "Update");
updateFunction();
However, the
Code:
getGlobal
Code:
luabridge
Code:
lua_getglobal
I am wondering if this has been replaced by a different function call or if it has been deprecated out of the 2.0 version. I can of course use the normal C Lua approach, but I was wondering if this has been abstracted in LuaBridge (to make things easier)