[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT FFI only bindings for glfw, OpenCL, OpenGL
- From: Mike Pall <mikelu-1101@...>
- Date: Wed, 26 Jan 2011 20:20:16 +0100
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
- References:
- LuaJIT FFI only bindings for glfw, OpenCL, OpenGL, malkia
- Re: LuaJIT FFI only bindings for glfw, OpenCL, OpenGL, CrazyButcher
- Re: LuaJIT FFI only bindings for glfw, OpenCL, OpenGL, Henk Boom
- Re: LuaJIT FFI only bindings for glfw, OpenCL, OpenGL, David Given
- Re: LuaJIT FFI only bindings for glfw, OpenCL, OpenGL, Mike Pall
- Re: LuaJIT FFI only bindings for glfw, OpenCL, OpenGL, Henk Boom