SDL* and GL bindings
Bruno Medeiros
brunodomedeirosATgmail at SPAM.com
Sat May 20 09:04:00 PDT 2006
My slightly ranty topic about the current state of SDL* and GL bindings.
Recently, some development in a program of mine made look for a new
SDL+GL binding other than the one I was using. I was a bit dismayed
about the current state of affairs, as I couldn't find a suitable
binding. The existing bindings (that I know of) are D-Porting, Derelict
and Anders's. The problems I found:
Dporting:
This was the version I was previously using (actually a modified version
with module statements). The problem is that this binding is not
actively developed (I think) and the creators are not accessible, at
least not easily (the Japanese D community?). This became an issue
because there is no documentation at all and I this I was unable to know
how this binding dealt with the SDL_main hack. Similarly how could I
suggest or discuss the implementation of proper module names?
Derelict:
I'm really not into Derelict's runtime lib loading. I think the
advantages presented by this method (see at Static Import Issues at
http://svn.dsource.org/projects/derelict/trunk/docs/index.html ) matter
very little. The first issue can be solved by a one person, one time
operation, who can then distribute the lib to other people. In fact, for
dmd it amounts to "coffimplib <foobar.lib>", which hardly is a nuisance.
As for the second issue, c'mon, what more than displaying an error
message can a program do when an /essential/ dll is not found? Indeed,
how many games (or any application for that matter) do you know that
have a different behavior when a dll is missing than the standard system
error message?
Meanwhile, I believe that the disadvantages, such as Derelict being
harder/longer to maintain/develop than a regular binding have much more
impact. For instance Derelict currently *still* doesn't support MacOS.
(Not that I use (or even like) Macs, but it's quite an important
platform that should be supported)
This seems a shame to me, since Derelict is clearly the binding with the
most commitment, exposure, and work done on it.
Anders's:
I assume the latest bindings are those of http://www.algonet.se/~afb/d/
am I right?
How does one work with the bindings? I don't know if they are supposed
to be compiled, or just imported header-style, as no doc/readme explains
it. And in any way:
- Compilation fails (at least the easy way) because of the mismatched
module names. What's up with that? Why do only sdl.main and sdl.sdl have
module statements?
- Importing as headers should work if one doesn't use
SDL_InitApplication, or so I thought, but it still fails because of a
missing:
Error 42: Symbol Undefined __init_6events9SDL_Event
caused by the "wchar unicode" of "SDL_keysym" which has a non-zero init.
Of course, it took me a while to figure this all out.
--
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d
mailing list