View previous topic :: View next topic |
Author |
Message |
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Mon Mar 29, 2010 8:18 am Post subject: My Plans for Derelict2 |
|
|
The publication of TDPL and the official release of D2 are right around the corner. I'm making a mad dash toward the finish line with Derelict2, hoping to get a few more tasks completed before that time. Here's a rough outline of what's in my head.
DerelictODE is the last package remaining to port over from the trunk. I'll get around to that later this week. After that, I'll be focusing on finishing DerelictGL extensions. Then, I have a few new packages I want to add (for the curious, that would be DerelictLua, DerelictFreeImage, DerelictFMOD (including FMODEX), DerelictPortAudio). Please don't ask me to add any more. I've thought long and hard about it and those are my priorities. It will be a while before I consider any other new packages. [EDIT] And, of course, documentation. I aim to do a more thorough job this time around.
The above are what I want in svn, tested, and working across Windows, Linux and Mac by the time D2 and TDPL roll out. I can handle the svn commits, but I'll need your help with the rest. The more you guys start using Derelict2 (especially on Mac!), the sooner it can get stabilized and moved to the trunk.
In the more distant future, after Derelict2 becomes "official", I'll be looking at how to handle OpenGL 3.x and OpenGL 4. The latter will almost certainly get it's own package. The former, I'm not sure about yet. At some point, I'll also be adding DerelictSDL2 and DerelictSFML2, contingent on the release of the next SDL and SFML versions. The current DerelictSDL and DerelictSFML will still be around, but they'll be considered deprecated and, somewhere way down the line, will be removed completely. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Wed May 05, 2010 4:25 am Post subject: |
|
|
As things stand now, DerelictODE has been ported over and DerelictFMODEX has been added. I've got an existing binding to PortAudio that I will modify and commit in the near future. As for the rest, I've got too much on my plate at the moment and really doubt I'll find the time to get it done before TDPL and D2 are out.
With that in mind, I've decided to spend the time I do have on documentation. That is my top priority regarding Derelict from now until it's done. As for the rest, I've created a few tickets to indicate what need doing. If anyone has the time and/or inclination to pick one of them up, it would be greatly appreciated. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
ponce
Joined: 12 Nov 2009 Posts: 55
|
Posted: Wed May 19, 2010 10:22 am Post subject: |
|
|
I've started a DerelictFreeImage binding, based on an existing code made by h3r3tic (his automated script may interest you Aldacron). _________________ @p0unce | gamesfrommars |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Fri May 21, 2010 4:06 am Post subject: |
|
|
Great! I'll give his script a look. Don't know of any scripts for pulling documentation out of my head, do you? _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
ponce
Joined: 12 Nov 2009 Posts: 55
|
Posted: Fri May 21, 2010 6:24 pm Post subject: |
|
|
So here is the FreeImage 3.13.1.0 binding. I did very few, all the hard work was done by h3r3t1c
http://dl.dropbox.com/u/541786/freeimage_Derelict2fied.zip
Compiles and load symbols with DMD 1.058 and 2.046 on Windows, library itself was not tested.
According to the original C header (and consequently h3r3tic binding too), FreeImage_OutputMessageProc is extern(C) while all others function would be extern(System). I find it quite suspicious but why not.
Another confusing thing is that the function names must be named in a particular way (with a _ prefix and a @4 or @8 or etc... suffix).
Code: |
bindFunc(cast(void**)&FreeImage_GetVersion, "FreeImage_GetVersion");
|
will fail and
Code: |
bindFunc(cast(void**)&FreeImage_GetVersion, "_FreeImage_GetVersion@0");
|
is correct.
But... will it work on Linux with this name ?
Do I miss something ?
What I don't quite understand this "let's-put-the-stack-frame-size-at-the-end-of-the-function-name" thing. Other libraries don't have that from what I remember.
_________________ @p0unce | gamesfrommars |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Sat May 22, 2010 3:49 am Post subject: |
|
|
Great! But, the name-mangling bit is a blocker for the moment. It's not going to work on platforms other than Windows, AFAIK. The @nn suffix is sometimes exported for functions with the __stdcall calling convention(which is what extern(Windows) is). But it depends on the compiler and, in the case of MSVC, whether the dll functions were exported via a DEF file or internally via __declspec(dllexport). Plus, the exported names can be adjusted to an unmangled form via a custom DEF file when compiling the lib.
So given that the default FreeImage build system apparently doesn't take steps to adjust the name mangling on Windows, this is going to be a bit of a headache. I didn't realize this was the case, so I'm going to have to give it some thought. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
ponce
Joined: 12 Nov 2009 Posts: 55
|
Posted: Sun May 23, 2010 10:49 am Post subject: |
|
|
One obvious solution would be to generate unmangled names from mangled one through a script, and provide :
Code: |
version(Windows)
{
// mangled names
}
version(LinuxOrMac)
{
// unmangled names
}
|
Both mangled and unmangled names are in freeimage.d (tough unmangled ones are unsorted).
Or maybe file a bug to the FreeImage crew. _________________ @p0unce | gamesfrommars |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
Posted: Mon May 24, 2010 4:02 am Post subject: |
|
|
Seems kind of backwards, I mean D has a built in "mangler", can't "func.mangleof" be used ? |
|
Back to top |
|
|
ponce
Joined: 12 Nov 2009 Posts: 55
|
Posted: Wed Jun 06, 2012 2:32 am Post subject: |
|
|
2 years later:
I lost my FreeImage binding, done it again, ran in the very same problem, solved it with templates.
The issue was that symbols are stdcall mangled "_functionname@12" not "functionname".
Aldacron are you ok with a DerelictFreeImage? _________________ @p0unce | gamesfrommars |
|
Back to top |
|
|
ponce
Joined: 12 Nov 2009 Posts: 55
|
Posted: Wed Jun 06, 2012 2:37 am Post subject: |
|
|
Note: the column mode + multiple selection in Sublime Text really speed up things while doing very repetitive work like a binding can be. _________________ @p0unce | gamesfrommars |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Wed Jun 06, 2012 3:01 am Post subject: |
|
|
ponce wrote: | 2 years later:
I lost my FreeImage binding, done it again, ran in the very same problem, solved it with templates.
The issue was that symbols are stdcall mangled "_functionname@12" not "functionname".
Aldacron are you ok with a DerelictFreeImage? |
Sure. If you want to hook it up for Derelict3 and post a pull request, I'll take it. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
ponce
Joined: 12 Nov 2009 Posts: 55
|
Posted: Wed Jun 06, 2012 3:31 am Post subject: |
|
|
Sure, will do.
On a related note, I just saw your post about building SDL_image against SDL2 so that they work together. _________________ @p0unce | gamesfrommars |
|
Back to top |
|
|
ponce
Joined: 12 Nov 2009 Posts: 55
|
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Wed Jun 06, 2012 11:16 pm Post subject: |
|
|
I managed to get rid of the forward reference errors (I was getting 2 -- FITAG and FREE_IMAGE_MDMODEL) by changing the import order at the top of freeimage.d. I'm baffled.
From what I gather, the 64-bit name-mangling for stdcall is "name@n", i.e. no leading underscore. That was just briefly mentioned on one website I found through Google, so I haven't yet verified it. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
|