lua-users home
lua-l archive

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


On 30 October 2011 14:22, David Hollander <dhllndr@gmail.com> wrote:
> Do you think it's necessary to wrap\couple ffi headers with lua
> metatables and functions? Ex. if two people have independently loaded
> the OpenAL\OpenGL\etc API headers, they can't share utility functions
> they've written on top of that API without getting ffi redefine
> errors, if said functions are coupled to (encapsulating) the loading
> of headers.
>
> - David Hollander

I rarely actually use ffi.metatype; I find you need to wrap objects in
a table/another structure to do useful things with them: eg, its nice
to use openal sources in an OO fashion; but they are just an integer
id (which you can't attach a metatable to).

Otherwise, I would find it strange if one application was using
multiple ffi bindings to the one library..... why not consolidate

D