no matching function for call to FMOD::Studio::System::setListenerAttributes()

238 views Asked by At

I'm trying to set listener's position as described in docs

FMOD::Studio::System* system;
ERRCHECK(FMOD::Studio::System::create(&system));
FMOD::System* lowLevelSystem;
ERRCHECK(system->getLowLevelSystem(&lowLevelSystem));

FMOD_3D_ATTRIBUTES attributes = { { 0 } }; 
attributes.forward.z = 1.0f;
attributes.up.y = 1.0f;
ERRCHECK( system->setListenerAttributes(&attributes) );
attributes.position.z = 0.0f;
ERRCHECK( instance->set3DAttributes(&attributes) );

But it says:

test.cpp: In function ‘int main(int, char**)’:
test.cpp:244:56: error: no matching function for call to ‘FMOD::Studio::System::setListenerAttributes(FMOD_3D_ATTRIBUTES*)’
     ERRCHECK( system->setListenerAttributes(&attributes) );
                                                        ^

Why?

1

There are 1 answers

0
Viktor On BEST ANSWER

I forgot to set an index of my listener:

ERRCHECK(system->setListenerAttributes(0, &attributes));