mdparker / Derelict3

A collection of dynamic D bindings to C libraries, useful for multimedia and game development.
169 stars 39 forks source link

Added all derelict2 WGL Extension #147

Closed ghost closed 11 years ago

ghost commented 11 years ago

Instead of generating the import code with some external tool, I used what is already available in D: mixins. It will be easier to change the code from now on and I think all the other modules should use a similar approach.

Edit: Fixed loadGLFunc and changed the name of the winext module . I noticed derelict use static if(Derelict_OS_Windows) instead version(Windows) so I didn't touch that.

mdparker commented 11 years ago

I hate to say this, because I appreciate the work you put into it. I know it's not something you only whipped up in 10 minutes. But I can't accept this.

In Derelict 2 we used a heaping helping of string mixins to support both D1 and D2. There was no way around it. It had a noticeable impact on compile times. Again, I realize that the actual impact in this case isn't going to be as large because it's on a smaller scale, but I'm very particular about this stuff.

Second, this would be the only module in Derelict to be implemented this way, which breaks consistency. Consistency is another very big deal to me. And given how I feel about my first point above, there's no way I'm going to convert every binding to do this. I made a conscious decision in the beginning to do everything by hand (I only use custom scripts to make global modifications to existing bindings, not to implement new ones) and to avoid string/template mixins entirely.

Sorry!

mdparker commented 11 years ago

In case you didn't notice, I've updated the repo with support for all WGLARB extensions. I haven't added any of the other extensions (3DL, EXT, etc...) since many of them are old (same for the GL* extensions). I will if anyone needs them.

If you hadn't have started this, who know when I would have gotten around to it. Thanks!