March 2016
Beginner to intermediate
340 pages
6h 51m
English
The first code that we need to add is the code that will initialize the audio engine. Just like we must initialize OpenGL, the code will set up FMOD and check to see if there are any errors along the way.
Open RoboRacer2D.cpp and add the following code to the variable declarations area:
FMOD::System* audiomgr;
Then add the following function:
bool InitFmod()
{
FMOD_RESULT result;
result = FMOD::System_Create(&audiomgr);
if (result != FMOD_OK)
{
return false;
}
result = audiomgr->init(50, FMOD_INIT_NORMAL, NULL);
if (result != FMOD_OK)
{
return false;
}
return true;
}This function creates the FMOD system and initializes it:
System_Create call creates the engine and stores the ...Read now
Unlock full access