0
0

Hello,

I started my first fmod-project today…yay

First I tried the sample code from the documentation and it worked flawlessly:

[code:35m6z2xk] // Create a System object and initialize.
FMOD::System system;
result = System_Create(&system);
ErrorCheck(result);[/code:35m6z2xk]

Then I created a sound manager class, made system a class member and it returned the error message ‘invalid parameter’:

[code:35m6z2xk]class CSoundMgr
{
System *m_pSystem;
...
};

bool CSoundMgr::Init()
{
// Create a System object and initialize.
result = System_Create(&m_pSystem);
ErrorCheck(result);
...
}[/code:35m6z2xk]

When I made system a static class member, it worked again:

[code:35m6z2xk]class CSoundMgr
{
static System *m_pSystem;
...
};

bool CSoundMgr::Init()
{
// Create a System object and initialize.
result = System_Create(&m_pSystem);
ErrorCheck(result);
...
}[/code:35m6z2xk]

Why is that? Why do I need static class members?
Unfortunately, I was unable to find anything about this in the documentation.
It would be nice if someone could explain or point me to the section in the documention..thank you

  • You must to post comments
0
0

Hi,
The system pointer you pass to FMOD doesn’t need to be a static class member. It seems like something else must be wrong.

I suggest you check the value of the ‘this’ pointer and of ‘&m_pSystem’ just before you call System_Create (i.e. print them out or put a breakpoint there).

Ben

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.