Need extern (C) interface even though using Derelict GLFW
WhatMeWorry via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jan 4 12:30:48 PST 2015
On Sunday, 4 January 2015 at 09:02:48 UTC, Mike Parker wrote:
> On 1/4/2015 1:34 PM, WhatMeWorry wrote:
>
>> Maybe GLFW callback functions can't handled through Derelict
>> GLFW?
>>
>>
> And just to be clear, because the pointers to the callback
> functions are being passed to a C API, they *have* to be
> extern( C ) -- i.e. they have to have the same calling
> convention that the C library expects. If the library functions
> used the stdcall calling convention rather than cdecl, then the
> callbacks would have to be extern( Windows ). So even a wrapper
> that allows you to pass D delegates or function pointers would
> still have to internally give GLFW a pointer to a function with
> the proper calling convention.
Thanks for the replies. I felt like I was creating a kludge.
I have to confess that the above paragraph is pretty much
incomprehensible to me. Except for "function pointers" the rest
of the terms I have seen before, but can't really make out into a
meaningful whole.
Are they some extremely simple tutorials on bindings and
wrappers? Something with lots of code examples.
More information about the Digitalmars-d-learn
mailing list