0
0

Hi, this is nullsquared over from at http://www.portalized.org. We’re currently evaluating sound options and have come across FMOD, however we’ve noticed various inconsistencies.

First – why is the Windows C++ version of the library compiled for MSVC but not MinGW? MSVC and MinGW are the most used compilers, and I do not understand how hard it can be to simply compile with MinGW in addition to MSVC – after all, you’ve already made the distinction via libfmodex.a and fmodex_vc.lib.

Second – why is the C interface so inconsistently named? System::init() in C++ but System_Init() in C, notice the capital. Considering there is no documentation what-so-ever on the C interface (and I must mention the C++ documentation is rather poor, the CHM format is extremely annoying and there don’t seem to be any concrete tutorials), I’d at least expect equivalent naming between the C++ and C interfaces. And unfortunately that’s not where it ends, there many more inconsistencies, such as FMOD_SYSTEM instead of the expected FMOD_System due to FMOD::System, etc.

Thanks.

  • You must to post comments
0
0

The MinGW question has been talked to death; The discussion is in the FAQ forum:
[url:2uk5n8p8]http://www.fmod.org/forum/viewtopic.php?t=4090[/url:2uk5n8p8]

The short answer is that the library is compiled with Microsoft Visual C++, and that, because there’s no standard for name mangling, compilers which don’t speak the same language as Visual C++ don’t understand how to link with the library. That’s part of the reason why the C API is made available.

The documentation for the C API is the same as the documentation for the C++ API. If you look in the CHM at every function, it contains both the C++ and the C declarations.

I’m not sure what your complaint about the CHM is. I’ve never had any trouble finding what I need. There are some very nice tutorial articles in the "Tutorials" section of the CHM, and the examples directory that installs with FMOD is chock full of great samples that show how to use it.

I’m not sure where the capitalization differences between the C and the C++ API come from. It might be a conscious choice, or it might be that they used a tool to generate the C header from the C++ headers, and it got some capitalization inconsistent. Either way, I’m not sure why this bothers you so much. Sure, it might have been nicer had they made the capitalization exactly the same, but it’s not really that big a deal.

  • You must to post comments
0
0

[quote="Adiss":176vxz9d]The MinGW question has been talked to death; The discussion is in the FAQ forum:
[url:176vxz9d]http://www.fmod.org/forum/viewtopic.php?t=4090[/url:176vxz9d]

The short answer is that the library is compiled with Microsoft Visual C++, and that, because there’s no standard for name mangling, compilers which don’t speak the same language as Visual C++ don’t understand how to link with the library. That’s part of the reason why the C API is made available.
[/quote:176vxz9d]
No where did I mention that I tried to link the MSVC library from MinGW. Clearly that will not work with a C++ API. I’m asking why it is so incredibly hard to compile the C++ API with MinGW in addition to the MSVC build?

[quote:176vxz9d]
The documentation for the C API is the same as the documentation for the C++ API. If you look in the CHM at every function, it contains both the C++ and the C declarations.
[/quote:176vxz9d]
Indeed, I did not notice this at first.

[quote:176vxz9d]
I’m not sure what your complaint about the CHM is. I’ve never had any trouble finding what I need. There are some very nice tutorial articles in the "Tutorials" section of the CHM, and the examples directory that installs with FMOD is chock full of great samples that show how to use it.
[/quote:176vxz9d]
CHM is an incredibly inconvenient format – there’s no tabs, no useful navigation between pages, etc.

[quote:176vxz9d]
I’m not sure where the capitalization differences between the C and the C++ API come from. It might be a conscious choice, or it might be that they used a tool to generate the C header from the C++ headers, and it got some capitalization inconsistent. Either way, I’m not sure why this bothers you so much. Sure, it might have been nicer had they made the capitalization exactly the same, but it’s not really that big a deal.[/quote:176vxz9d]
It bothers me because I cannot write code fluently as I can with other libraries that have conistent naming. With FMOD, I’m forced to look up everything in the (utterly annoying) CHM file.

  • You must to post comments
0
0

I think that the real issue is one of maintenance, not of technology. If you look at the FAQ topic I linked to, you’ll see that Brett from FMOD said:
[quote:1udoq1bv]there are about 4 or 5 compilers out there, mingw isnt the only one so it would be a real pain for us to maintain and support 8-10 dlls[/quote:1udoq1bv]

But that’s why the C API is provided. :)

I empathize with your complaints about CHM. It doesn’t bother me as much, but I can understand why you’d want a better viewer than hh.exe. There are plenty of viewers out there, including a handy CHM Reader Add-on for Firefox:
[url:1udoq1bv]https://addons.mozilla.org/en-US/firefox/addon/3235[/url:1udoq1bv]

I realize that won’t solve all of your complaints about CHM, but it will take care of some of them (tabs, for example).

I just had another look at the C API, and I see no inconsistencies. The pattern is:
Types are FMOD_UPPERCASE_WITH_UNDERSCORES
Function Names are FMOD_TitleCaseType_TitleCaseFunction

That’s completely consistent throughout the entire C API. It differs only slightly from the C++ API, but it is entirely self-consistent.

  • You must to post comments
0
0

[quote="Adiss":21364mlv]I think that the real issue is one of maintenance, not of technology. If you look at the FAQ topic I linked to, you’ll see that Brett from FMOD said:
[quote:21364mlv]there are about 4 or 5 compilers out there, mingw isnt the only one so it would be a real pain for us to maintain and support 8-10 dlls[/quote:21364mlv]

But that’s why the C API is provided. :)
[/quote:21364mlv]
Correct, however MinGW (well, GCC in general) and MSVC are the most used. There are indeed more compilers but they are not as common as MSVC and MinGW/GCC.

[quote:21364mlv]
I empathize with your complaints about CHM. It doesn’t bother me as much, but I can understand why you’d want a better viewer than hh.exe. There are plenty of viewers out there, including a handy CHM Reader Add-on for Firefox:
[url:21364mlv]https://addons.mozilla.org/en-US/firefox/addon/3235[/url:21364mlv]

I realize that won’t solve all of your complaints about CHM, but it will take care of some of them (tabs, for example).
[/quote:21364mlv]
Thanks!

[quote:21364mlv]
I just had another look at the C API, and I see no inconsistencies. The pattern is:
Types are FMOD_UPPERCASE_WITH_UNDERSCORES
Function Names are FMOD_TitleCaseType_TitleCaseFunction

That’s completely consistent throughout the entire C API. It differs only slightly from the C++ API, but it is entirely self-consistent.[/quote:21364mlv]
Hm, I see. Indeed, it seems to be self-consistent. I was expecting it to be consistent with the C++ API, but oh well.

I already integrated the C API at the time of my OP, but the initial frustration it causes may and will deter others.

  • You must to post comments
0
0

>> I was expecting it to be consistent with the C++ API, but oh well

It is consitent with c++ api…

ObjectType::function(data) == ObjectType_Funtion(ObjPointer,data)

  • You must to post comments
0
0

[quote="icuurd12b42":1lhblrkx]>> I was expecting it to be consistent with the C++ API, but oh well

It is consitent with c++ api…

ObjectType::function(data) == ObjectType_Funtion(ObjPointer,data)[/quote:1lhblrkx]
Base naming is consistent, capitalization is not. Remember, C++ is case sensitive 😉

What would help is an explanation of the differences between the C API and the C++ API in the documentation. Something nice an simple, like:

The C API is named equivalently to the C++ API with some minor case differences, such as:

SomeType: C++
SOME_TYPE: C

someInstance->someFunction(data): C++
SomeType_SomeFunction(someInstance, data): C

That is all that is needed to eliminate initial frustration. Plus possibly replacing the .chm with a more convenient, wide-spread format.

  • You must to post comments
0
0

FMOD::Sound *sound;
result = system->createStream("../media/wave.mp3", FMOD_NONBLOCKING, 0, &sound);

=

FMOD_SOUND *sound;
result = System_CreateStream(pSystem,"../media/wave.mp3", FMOD_NONBLOCKING, 0, &sound);

It’s not that hard… And the confusion will fade in a few days… It’s anoying to convert a c++ example though. And verify with the help that you have it right…

The onthing that got me scratching my head for a second was

FMOD::System *system;
result = FMOD::System_Create(&system);

=

FMOD_SYSTEM *system
FMOD_System_Create(&system);

The help shows the 2 version and there are C examples in the source…

[quote:18piraic]
C++ Syntax

FMOD_RESULT System::createStream(
const char * name_or_data,
FMOD_MODE mode,
FMOD_CREATESOUNDEXINFO * exinfo,
FMOD::Sound ** sound
);

C Syntax

FMOD_RESULT FMOD_System_CreateStream(
FMOD_SYSTEM * system,
const char * name_or_data,
FMOD_MODE mode,
FMOD_CREATESOUNDEXINFO * exinfo,
FMOD_SOUND ** sound
);
[/quote:18piraic]

It’s all in the help. Are you having trouble reading the file? Someone converted the help to hmtl if I remember right. So that may help you. Or get winhelp…

C++ is so overated LOL… In this case, the C interface is so well done, I wonder why they bothered making it c++… Or was the s++ made first and everything is wrapped in c functions?

  • You must to post comments
0
0

[quote="icuurd12b42":3w414tq2]And the confusion will fade in a few days…[/quote:3w414tq2]
It fades in only a few hours. It’s just the beginning 1 hour that you don’t know how to start with the C API compared to the C++ one. Actually I haven’t touched FMOD since the day I integrated it, so it doesn’t really matter.

[quote:3w414tq2]
It’s all in the help. Are you having trouble reading the file? Someone converted the help to hmtl if I remember right. So that may help you. Or get winhelp…
[/quote:3w414tq2]
CHM is very annoying to navigate by default. The firefox extension makes it only slightly better because it has its own flaws. I do not understand why something like doxygen was not used instead.

  • You must to post comments
0
0

Well, there is already a help viewer included in Windows, so that was an obvious choice, so no one need to download a viewer for the document. But with Vista… You have to grab the viewer for older help files…

I use html myself now. Less trouble.

  • You must to post comments
Showing 9 results
Your Answer

Please first to submit.