Hiya
I've recently taken a look at the FMOD API and I've noticed that it appears to be a C API, with a really thin C++ wrapper. I'm interested in understanding how they've implemented it.
The C++ classes in the header have no virtual methods or destructor, so they're not inheriting from these classes. Which makes me think that a member function like the following is implemented by just calling the equivalent C function:
FMOD_RESULT System::createSound(...)
{
return FMOD_System_CreateSound(this, ...);
}
That C function takes a pointer to an FMOD_SYSTEM, which is declared like this:
typedef struct FMOD_SYSTEM FMOD_SYSTEM;
Which makes no sense to me. What does typedef'ing like this do, when FMOD_SYSTEM is undeclared? And how can the C function take an FMOD_SYSTEM parameter, but they must be passing a pointer to an FMOD::System class?
Many thanks!