Need extern (C) interface even though using Derelict GLFW

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 4 01:02:49 PST 2015


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.


More information about the Digitalmars-d-learn mailing list