SDL* and GL bindings

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Mon May 22 10:09:10 PDT 2006


Mike Parker wrote:
> Bruno Medeiros wrote:
> 
>>
>> But since dll's are usually packaged with the game/app itself, isn't a 
>> missing dll something so rare that it is exaggerated to worry about it 
>> so much? How can it happen at all, it seems so far-fetched.
> 
> That's true for things like SDL and such, but not OpenGL. Sometimes 
> downloads become corrupted, installations get borked, people delete 
> files by accident... there are a lot of variables.
> 
> When Herb Marselas was still with Ensemble Studios he wrote an article 
> for Game Programming Gems 2 called "Protect Yourself From DLL Hell and 
> Missing OS Functions" in which he advocated even loading Win32 API DLLs 
> manually. I'm not sure I'd go that far, as there are other applications 
> that would likely barf before a game would. But his reasoning in the 
> article was sound.
> 

The only time I can recall that an app unexpectedly didn't load a dll, 
was for some of the MSVC runtime libs. So following your reasoning, you 
should load these libs dynamically too.. *g* :P

> 
>>
>> Wouldn't a pure header conversion work in all platforms that the 
>> original header works in?...
>> It doesn't work on Mac, and it didn't work before in Linux because you 
>> need to add the code to the dynamic binding, right?
> 
> Right. But then that would defeat the purpose of Derelict. Again, the 
> other bindings already link to the import library statically. Derelict 
> is meant to provide an alternative.
> 
>>
>>>
>>> For what it's worth, one of the future additions to Derelict is going 
>>> to be the ability to link statically with an import library and 
>>> bypass the runtime loading mechanism. 
>>
>> That would be great!
> 
> I'm glad you think so, but I still don't understand why. I flip-flopped 
> on this for a long time, because it means double the effort and I just 
> don't see the benefit of it versus the current mechanism. Manual loading 
> is much more flexible, which to me equates to "better". I can't see any 
> benefit at all to linking statically to the import libraries, other than 

Well, if dynamic loading supports all platforms that static loading, 
then there really isn't much difference. But as we know, that is not the 
case. ;p


-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list