0

Trying to learn FMOD for a school project.

Copied straight from documentation:

FMOD_RESULT result;
FMOD::System *system;
result = FMOD::System_Create(&system);      // Create the main system object.
if (result != FMOD_OK)
{
    printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
    exit(-1);
}
result = system->init(100, FMOD_INIT_NORMAL, 0);    // Initialize FMOD.
if (result != FMOD_OK)
{
    printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
    exit(-1);
}

What does the first line FMOD_RESULT result mean? I found the page in the documentation but it made absolutely no sense.

abligh
  • 24,573
  • 4
  • 47
  • 84

1 Answers1

0

FMOD_RESULT is an typedef for enum, what makes FMOD_RESULT result; line a variable declaration. You can see what values it can be assigned by checking the fmod.h header file.

All the FMOD functions return FMOD_RESULT value, so that you can check if the function succeeded or what was the error.

prajmus
  • 3,171
  • 3
  • 31
  • 41