SFML community forums
Bindings - other languages => D => Topic started by: krzat on October 12, 2012, 10:09:05 am
-
Github site: https://github.com/krzat/SFML-D
Ready to use package(windows): https://github.com/downloads/krzat/SFML-D/working_sample.7z
I have tested it on Windows(DMD and GDC), but it may also work on other platforms. To see how it works, check the test.d file. I have also attached .bat scripts for easy compilation (GDC or DMD required).
Most of this code is autogenerated, so expect some bugs.
EDIT: new version, added network and removed auto functions
EDIT2: uploaded to git, and separated modules
-
Nice work! This is really cool!
I too am working on a wrapper, but looks like you beat me!
This is really cool though, and I am glad to look at different ways of doing bindings! It even gave me a few ideas for my own project.
By the way, what did you use to auto generate all this code? That's pretty spiffy.
-
I have:
1. used gcc to generate processed C header
2. cleaned that file, so htod could work
3. used htod to convert C header to D file
4. used my own program to:
a. fix compiler errors of D file(htod is a bit outdated)
b. remove comments and empty lines
c. remove sf prefix from struct names
d. collect every opaque struct
e. collect every function with name like someOpaqueStruct_someFunc(T* ptr, ...);
f. in another file: generate class and methods in it for every collected struct
5. added some manual fixes
I have updated the wrapper: added network classes, and proper return types for functions (becouse auto breaks Mono-D autocompletion).
-
That's pretty funny that you named it SFML-D. I was was planning on using the same name! And I was also just about to put it on github.
Stealin' my thunder :P
-
Oh, sorry for that. I can change the name if you want.
Btw. how much of the wrapper have you finished?
-
Oh, it's cool man. It's just a name. ;D
I have all of the system and window modules done except for a couple of things. I'm not going for just a wrapper though. I'm pretty much porting the API into D. Currently I'm working on getting some of the inheritance stuff working for the graphics module(drawable for instance) , but I'm also going to play around with the audio module soon too.
I'm doing everything by hand though. It's a project for better learning some of the semantics of the D language. I'm sure that as I learn more I might go back and rewrite some things(like my own bindings. currently I'm using derelict as a back end), but so far it all works pretty well. It definitely makes me happy how nice of an API SFML is, and I like how well it is documented.
-
Hi, thanks for creating these. Nice and simple.
I've updated your wrapper to work with the latest git version of CSFML and D release. Well, actually I've only verified that the sample program compiles and works. If there are any new functions in CSFML I haven't added them. Anyone using the old [C]SFML builds on the website will probably want krzat's version instead.
https://github.com/rversteegen/SFML-D (https://github.com/rversteegen/SFML-D)
-
Hi guys,
the Yage3D project is interested in this binding ;) JoeCoder is now going D2 and if you look at the new branch you can see some OO wrapping around the "window" module already... Which may not be necessary if a good OO Wrapper like yours is available! So I beg you to keep up the good work.
-
Just a heads up, I am almost done with my version of a "wrapper" for CSFML in D. It's very similar to this, but my ultimate goal was to have it become the official DSFML so there are a few extras on top of it just wrapping things in a OO way. Class has been taking up a lot of my time but I should have the first version finished in no longer than 2 weeks. (the end of this week is my last week of classes so I planned on finishing up the last of it asap)
I wanted to get it finished before I really said anything, but with Laurent's binding post I thought I should speak up!
And also, I have a few ideas for improving how it works that I will implement after I finish getting it "working".
Happy programming guys!