FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fixes + DerelictALUT

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
darkuranium



Joined: 26 Jan 2008
Posts: 10

PostPosted: Sun Dec 07, 2008 3:06 pm    Post subject: Fixes + DerelictALUT Reply with quote

Hey, I'd like to report some errors that I've noticed in a few derelict modules (and a new module). Here they are:

New files (I would have created patches, but the tool seems screwy):
vorbiscodec.d: http://paste.dprogramming.com/dpht0899
vorbisfile.d: http://paste.dprogramming.com/dprii23a
ogg.d: http://paste.dprogramming.com/dpr5jpok

---------------------- UPDATE ------------------------
The files can now be found here:
http://soulbreakers.com/usr/darkman/d/derelict/
--------------------------------------------------------

DerelictVorbis:
vorbiscodec.d changes:
-Vorbis seems to use libvorbis.dll, not vorbis.dll. I would have renamed them all (see vorbisfile.d and ogg.d), but libvorbis.dll wants libogg.dll, not ogg.dll. Note that this has to be prepended, as the binaries that come with the app (which are usually the most compatiable) are most probably going to be libvorbis.dll, not vorbis.dll (perhaps the missing lib is part of the older version?) -- see http://xiph.org/downloads/ (vorbis-tools 1.2.0 (win32 binaries))

vorbisfile.d changes:
-ov_fopen was missing. Added -- see http://www.xiph.org/vorbis/doc/vorbisfile/ov_fopen.html
-ov_test used FILE*, made it call ov_test_callbacks, just like ov_open
-Vorbis seems to use libvorbisfile.dll, instead of vorbisfile.dll -- prepended to the list of DLLs

DerelictOgg:
ogg.d changes:
-added libogg.dll to the list of libs


Also, I created some new bindings, DerelictALUT. I was thinking that you could add it to the list of unofficial bindings (although they were created to work just like the official ones).

I also cleaned up the DerelictGLFW code, the bindings work much more like the official ones now. It will also be uploaded.

I think I'm going to add tests for each of these (ALUT/GLFW), once I get time.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sun Dec 07, 2008 7:05 pm    Post subject: Reply with quote

The difference between the DLL names might have to do with which compiler toolchain is used. By convention, some libraries on Windows are created as lib*.dll when using MingW or Cygwin and as *.dll when using MSVC. That's just a guess, though, as I've not looked at the make files for libogg or libvorbis. But googling shows that both forms (ogg.dll and libogg.dll) are floating around out there in the wild. So I'll add your fixes when I update the ogg/vorbis stuff to the latest version.

As for ALUT, I just removed support for some ALUT functions from al.d. In the headers I used to create the initial binding, there were only a handful of alut functions. They were declared in al.h, special-cased for Windows, and not a separate download. When I updated recently, I saw the alut stuff had been removed from al.h. I didn't realize it was a separate download now.

I don't know anything about alut. Is it widely used? Is it cross-platform now? Is it an official openal library or is it more like glut? I'll look into this and if it seems worth while, I'll add your binding to DerelictAL. I won't add a new package for it. I'm going to be combining several related packages in the near future (such as DerelictGL/GLU).
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
darkuranium



Joined: 26 Jan 2008
Posts: 10

PostPosted: Mon Dec 08, 2008 8:49 am    Post subject: Reply with quote

aldacron wrote:
I don't know anything about alut. Is it widely used? Is it cross-platform now? Is it an official openal library or is it more like glut? I'll look into this and if it seems worth while, I'll add your binding to DerelictAL. I won't add a new package for it. I'm going to be combining several related packages in the near future (such as DerelictGL/GLU).

Well, I never heard about ALUT not being crossplatform...

But about the "is it official" bit, the reference seems to be on the same page as the official documentation:
http://connect.creativelabs.com/openal/Documentation/Forms/AllItems.aspx

Besides, even if you don't "approve" ALUT, you could at least add the link to dsource.org projects page Smile
Regarding DerelictGLFW, yes, there are official GLFW bindings for D, but they are crap and won't work with newer versions of DMD (they must have been created before DMD 1.0). So far, I was unable to come in contact with the author... I'll try again today. GLFW is a nice lib to have Smile
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Mon Dec 08, 2008 7:53 pm    Post subject: Reply with quote

darkuranium wrote:

Besides, even if you don't "approve" ALUT, you could at least add the link to dsource.org projects page Smile


So can you Smile It's a Wiki.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
darkuranium



Joined: 26 Jan 2008
Posts: 10

PostPosted: Sun Jan 04, 2009 5:21 am    Post subject: Reply with quote

Well, apparently, even in the newest libvorbis.dll, ov_fopen() does not exist (despite it being documented), so perhaps it should be commented out for now.

EDIT: And you forgot to add ov_test wrapper instead of the function, because it uses FILE* too (same applies to it as to ov_open):

Code:
//===============================================
// ov_test
//===============================================
int ov_test(FILE *f, OggVorbis_File *vf, char *initial, long ibytes)
{
    // Fill the ov_callbacks structure
    ov_callbacks    vorbisCallbacks;    // Structure to hold pointers to callback functions
    vorbisCallbacks.read_func  = &Derelict_VorbisRead;
    vorbisCallbacks.close_func = &Derelict_VorbisClose;
    vorbisCallbacks.seek_func  = &Derelict_VorbisSeek;
    vorbisCallbacks.tell_func  = &Derelict_VorbisTell;

    return ov_test_callbacks(f, vf, initial, cast(int)ibytes, vorbisCallbacks);
}


Edit2: You also forgot about the lib* versions:
libvorbis.dll
libvorbisfile.dll
libvorbisenc.dll
libogg.dll
I would prepend those (rather than appending), since DMD/GDC best work with MinGW dlls (rather than the MSVC ones) -- but it's your choice.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sun Jan 04, 2009 11:39 pm    Post subject: Reply with quote

OK, updated the trunk with the changes. And you are absolutely right in that I did forget. It's probably a good idea if you add a new ticket when you have fixes/changes to suggest in future. I don't check the tickets every day, but I do check them eventually. These forum threads often fall off of my radar and I forget about them if they aren't updated again.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Mon Jan 05, 2009 8:14 am    Post subject: Reply with quote

One more thing to do :> Line 103 in http://dsource.org/projects/derelict/browser/trunk/DerelictVorbis/derelict/ogg/vorbisfile.d?rev=324#L103 should be removed or you get "derelict/ogg/vorbisfile.d(103): function derelict.ogg.vorbisfile.ov_test (_iobuf*,OggVorbis_File*,char*,long) does not match parameter types ()"
Back to top
View user's profile Send private message MSN Messenger
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Mon Jan 05, 2009 9:14 pm    Post subject: Reply with quote

Thanks, Tom. Fixed.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group