SDL* and GL bindings
Bruno Medeiros
brunodomedeirosATgmail at SPAM.com
Sun May 21 04:14:47 PDT 2006
Anders F Björklund wrote:
> Bruno Medeiros wrote:
>
>> Anders's:
>> I assume the latest bindings are those of
>> http://www.algonet.se/~afb/d/ am I right?
>
> Yeah, although not in the zip files but *only* in the cvs section.
>
Ah, hadn't noticed that.
> But I just updated the old versions that were provided by DedicateD,
> and are also available from Japan: http://shinh.skr.jp/d/porting.html
>
Huh? I don't understand what you mean here. Where your bindings also
based on DedicateD? What what does that have to do with the D-Porting
bindings and why did you mention it?
> A recent post included more modern/open source versions of the headers,
> built from Mesa OpenGL and FreeGLUT instead of "my" SGI OpenGL and GLUT.
>
> http://www.digitalmars.com/d/archives/digitalmars/D/announce/2982.html
>
*Sigh*, yes, another binding to the mix. Like you said it seems similar
to Derelict, except it is based on different GL headers?
I (currently) don't know enough about OpenGL to know the differences
(and thus the advantages) between those newer/older opengl headers, so I
don't know how more useful that binding would be over Derelict. (Meaning
I'd rather use Derelict over that one)
>> 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.
>
> The makefiles and sample projects are all in the CVS for now, sorry.
>
> Basically I just include everything in sdl/*.d and link it with SDL ?
> (similar to how you use it from C, so it's wasn't very documented no)
>
No, you *also* have to link with the SDL_D libs, right? (This is
something that must be mentioned.)
>> 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?
>
> The other ones just had implicit names, since they're all in "sdl"...
>
I know they have implicit names, I can see that myself :P
But it is still broke. It works *only* if you compile each module
separately, *and* if you only import sdl.sdl (or sdl.main) in your
application. (if you import certain other sdl modules it breaks)
Surely you agree this is not proper behavior.?
>> - 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.
>
> It should work with the mentioned Makefile, which builds a D library
> (some of the SDL import modules do generate code, it's inevitable)
>
> But when I said that I should really, really package it up better -
> this is what I meant. It works for me, but I haven't documented it.
>
>
The doc needed for this kind of stuff isn't much, just a couple
paragraphs on a README file, I think.
> Once I update the headers to SDL 1.2.10 (etc), I will package it up too.
> It will probably only work with GDC, but Derelict is good for DMD use ?
>
Whoa! "will probably only work with GDC" !? :|
(And MikeP also mentioned that Derelict didn't work with GDC as of yet)
Are GDC and DMD so far off from each other that it is hard to build code
that works in both?! What kind of things are working differently? (I
only know of 'the lack of newer D features', and 'the typeof ==/is
problem', both of which don't seem very problematic to the creation of
bindings.)
> I also promised to write a tutorial for it, similar to the ones at:
> http://dmedia.dprogramming.com/Main/Tutorials
>
> --anders
--
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d
mailing list