lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Henk Boom wrote:
> That's good to know. Is there a way to bind a function by address
> instead of by name so that *GetProcAddress() can be used?

Declaring it as a function pointer ought to work:

ffi.cdef[[
void (*glExtGetShadersQCOM)(unsigned *shaders, int maxShaders, int *numShaders);
]]

local lib = ffi.load(...)
lib.glExtGetShadersQCOM(...)

Yes, the FFI automatically dereferences function pointers for
calls.

--Mike