lua-users home
lua-l archive

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


On 26 January 2011 08:05, Mike Pall <mikelu-1101@mike.de> wrote:
> David Given wrote:
>> GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint
>> maxShaders, GLint *numShaders);
>>
>> The GL_APICALL and GP_APIENTRY macros can be defined by the platform to
>> provide platform-specific tweaks to the ABI. Normally GL_APICALL is
>> defined to 'extern' or '__declspec(dllimport)' and GL_APIENTRY to a
>> compiler-specific calling convention specifier like '__stdcall' or
>> '__ccall'. Which of course means that the ABI can vary drastically
>> depending on how your OpenGL library has been built, even on a single
>> platform, which means that maintaining an FFI-compatible repository of
>> function prototypes isn't adequate.
>
> Neither should be a problem for the LuaJIT FFI. The import stubs
> are not needed and __stdcall is automatically detected. So just
> omit any calling convention in the declaration and the FFI will
> figure it out for you.

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?

    henk