View previous topic :: View next topic |
Author |
Message |
randomZ
Joined: 04 Dec 2004 Posts: 31 Location: Tuebingen, Germany
|
Posted: Thu Dec 16, 2004 4:26 pm Post subject: Adding new libraries |
|
|
Hi,
for something I'm working on, I'd like to port SDL_ttf to D. Am I right in thinking I need to do the following:
- Get SDL_ttf to compile with DMC
- Convert the SDL_ttf headers to D
Any tips you could give me beforehand?
Thanks,
Sebastian
EDIT: Crap, that means I also have to compile freetype, doesn't it? |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Fri Dec 17, 2004 5:22 am Post subject: Re: Adding new libraries |
|
|
randomZ wrote: | Hi,
- Get SDL_ttf to compile with DMC
|
This is not really necessary. If you look at the source to the various Derelict packages, you will see that I am loading the shared libraries explicitly via std.loader. What this means is that you do not need to link to any static link libraries. Derelict gets a handle to each shared library, then loads all exported functions and data manually.
Going by the title of this post, I assume you would like to add this to Derelict. If that is the case, then I will not accept any ports that load the shared libraries implicitly (i.e. by linking to the DLL's static link library). That's what separated Derelict from some of the other bindings around.
But if you were to create a binding that loaded the shared lib implicitly, you still would not need to compile SDL_ttf with DMC. All you would need to do is use the tool 'coff2omf' (or whatever it's called - the DigitalMars version, not the Borland version, as DMC's OMF and Borland's OMF seem not to be compatible) to convert the COFF version of the static link library (the format used by MSVC++) the OMF format used by DMC and D.
Quote: |
- Convert the SDL_ttf headers to D
|
This, unfortunately, is a necessity. And if you are doing it the Derelict way you will need to declare function pointer types in place of the normal function declarartions along with the actual function pointer variables, then load everything from the shared lib.
Quote: |
Any tips you could give me beforehand?
|
This can be a lot of work depending upon the size of the library (Python is killing me) and complexity of the headers (I gave up on libpng). I haven't looked at SDL_ttf, but if it is anything like SDL_image or SDL_mixer, then it should be a snap. I suggest you look at DerelictSDLMixer and DerelictSDLImage in the current svn trunk and use those as a guide.
Quote: |
EDIT: Crap, that means I also have to compile freetype, doesn't it? |
Actually, no it doesn't. |
|
Back to top |
|
|
xicesky
Joined: 19 Dec 2004 Posts: 6
|
Posted: Sun Dec 19, 2004 2:59 pm Post subject: |
|
|
SDL_ttf support for derelict would be great!! (SDL_net may be useful too, i think SDL supports more systems than phobos at the moment...)
Derelict is great anyway, i'm using it to create a tetris clone for my girlfriend atm. I'll release it under GPL if its ready to play...
Thanks for Derelict, keep up the great work! |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Mon Dec 20, 2004 10:34 am Post subject: |
|
|
xicesky wrote: | SDL_ttf support for derelict would be great!! (SDL_net may be useful too, i think SDL supports more systems than phobos at the moment...)
Derelict is great anyway, i'm using it to create a tetris clone for my girlfriend atm. I'll release it under GPL if its ready to play...
Thanks for Derelict, keep up the great work! |
I'm happy to hear you find it useful SDL_net will make it in there eventually. |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Sat Dec 25, 2004 6:50 pm Post subject: |
|
|
Derelict is usefull, indeed Good work! SDL net is a good library to add, I third that! Good luck, have a fun relaxing holiday, don't work too hard. |
|
Back to top |
|
|
randomZ
Joined: 04 Dec 2004 Posts: 31 Location: Tuebingen, Germany
|
Posted: Sun Dec 26, 2004 2:54 pm Post subject: |
|
|
It was an hour of brain-numbing work, but I think I succeeded. At least I could get a test program to display some text. I haven't tested every single function.
Where should I send it for inclusion in derelict? |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Sun Dec 26, 2004 7:50 pm Post subject: |
|
|
randomZ wrote: |
Where should I send it for inclusion in derelict? |
You can email it to me (same handle as here) at gmail.com. |
|
Back to top |
|
|
barrett9h
Joined: 02 May 2005 Posts: 26 Location: Brazil
|
Posted: Sun May 15, 2005 8:07 am Post subject: SDL_gfx |
|
|
I'm starting to try with SDL_gfx.
Wish me luck. |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Sun May 22, 2005 2:40 pm Post subject: |
|
|
here's a tip: take a look at the SDL image derelict file for reference, and copy/paste is your friend : ) |
|
Back to top |
|
|
barrett9h
Joined: 02 May 2005 Posts: 26 Location: Brazil
|
Posted: Mon May 23, 2005 7:12 am Post subject: my own |
|
|
Ok, I have SDL_gfxprimitives (the most important part, for me, of the SDL_gfx library suite) working now.
It was not that hard. Many vi tricks with advanced regexp search/replace.. :)
I even ported the test program that cames with it, and it worked flawlessly (but a bit slower than with plain C).
Now I want to port a library of my own, that I used in a game I wrote that I want to port to D. I did the same, but when I try to run I get:
Error: Failed to load shared library Failed to load shared library libflush.so.1
Sadly, I have had little spare time at best, but I'll get back at this someday.. |
|
Back to top |
|
|
|