Implicit Delayed DLL Loading?

Vladimir Panteleev vladimir at thecybershadow.net
Tue Jan 4 02:57:05 PST 2011


On Tue, 04 Jan 2011 12:44:07 +0200, Andrej Mitrovic  
<andrej.mitrovich at gmail.com> wrote:

> I think Derelict loads the DLLs at load time, before the call to
> main() (I could be wrong here). Delayed loading is when a DLL is
> imported at runtime when there's an actual call made that requires the
> DLL, it doesn't get preloaded at load time.

Technically you have to ask Derelict to load a DLL explicitly, like this:

DerelictSDL.load();

Anyway, it shouldn't be hard to implement "real" delayed loading on top of  
SDL's methods. In fact, you could even enumerate all function variables at  
the module level, and generate delay-loading code at compile time. This  
way you only need to mention any specific DLL function once.

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d mailing list