0

I have this function (written in C++ here):

GameSession *theSession = NULL;
...
...
startSesion(&theSession)

I have managed to get this running properly using the LuaJIT FFI here:

local session = ffi.new("GameSession*[1]", {})
myDLL.startSession(session))

However, I now need this function in LuaJIT (written in C++ here):

setTimeout(theSession, 3000);

How can this be achived in LuaJIT? Basically how can I declare theSession* from theSession** using the FFI?

theman
  • 345
  • 1
  • 14

1 Answers1

2

As per FFI Tutorial, you dereference pointers like this:

theSession[0];
W.B.
  • 5,445
  • 19
  • 29