DerelictSDL Updates for Mac
November 15th, 2008 | by Aldacron |For some time, one of the biggest issues in Derelict was with using DerelictSDL on Mac. In the C world, the SDLmain library is a rather hacked means of providing a common entry point for SDL apps across multiple platforms. Unfortunately, some important initialization was put into the library on Mac making it pretty much a necessity on that particular platform. This posed a problem for applications using DerelictSDL, as the initialization was not being handled at all since it didn’t live in SDL proper.
There were a few creative workarounds for it, all of which required manual handling by DerelictSDL users. If you’re curious, you can read about some of them in a six-page thread in the Derelict forums (and can find a few more threads if you search). Ultimately, though, what I wanted was a solution that was completely opaque — no need to call any special initialization methods or to link with any external libraries. Since I don’t have access to a Mac, I just waited for someone to step up and do something about it.
I’m happy to say that Jacob Carlborg (a.k.a. doob) did just that. Now, Mac users can use DerelictSDL without needing to resort to any dirty tricks. Just call DerelictSDL.load and all will be well with the the universe (unless you happen to be doing any Cocoa initialization yourself, at which point the universe might actually turn upside down). Thanks, doob!
Technorati Tags: D Programming Language, Derelict, DerelictSDL, SDL, Mac