[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT FFI Callbacks
- From: Paul Bonser <misterpib@...>
- Date: Wed, 11 May 2011 21:09:49 -0500
On Thu, Apr 14, 2011 at 7:23 AM, Michael Gogins
> Thanks so much for the FFI metamethods. Can we anticipate "C" calling
> convention callbacks into LuaJIT+FFI code from non-Lua compiled code? Is
> there any way to hack this at this time?
The solution I ended up going with is to have a normal C module which
registers event listeners, and a function in that module to call to
get a list of events which took place. It works well enough for GLFW
One call to registerEventListeners at the beginning of the program,
and calls to pollEvents in the event loop. pollEvents returns a table
with all the events that have happened since the last call.
I'd love to cut out the middleman and register the callbacks directly
from Lua, of course, but this works well in the meantime...
Paul Bonser | http://probablyprogramming.com | @pib