OgreAL causing Assertion Failed

HerrCron

25-04-2007 22:13:01

Hey, i've just started working with OgreAL today, and while it seems to be very handy, i'm having a few teething problems. Normally, i'd try and work this out myself, but time is against me.

Anyway onto the problem at hand

I have one file called GDD.cpp

This basically acts as a root point for my program, and it contains information for switching between various states in the program.

So, when a state is called, it is passed the main SceneManager and everything attaches itself to that.
then, when a state is swapped, the mSceneMgr->clearScene() command is called.

This works well, so we add OpenAL to the mix.

The current, simple settup is like this

in GDD.h i have the following


OgreAL::SoundManager *mSoundManager;
OgreAL::Sound *bgSound;


Then, in the settup section of the GDD.cpp


mSoundManager = new OgreAL::SoundManager(mSceneMgr);
bgSound = mSoundManager->createSoundStream("ZeroFactor", "Zero Factor - Untitled.ogg", true);
bgSound->setGain(0.5);
bgSound->setRelativeToListener(true);


So far, fine.
So, to start the background music we have this in the FrameStart function


if(State == STATE_INTRO)
{
if(!(bgSound->isPlaying()))
bgSound->play();
...
}


Which should start the sound if it's not playing.

Now, the program loads up, and starts playing the music no problem.
However once i attempt to change the state the program throws the following error


Assetion Failed!
Program F:\OgreSDK\GDD\bin\release\GDD.exe
file: ..\src\OgreALListener.cpp
line 41

Expression ms_Singleton


Which confuses me no end. The only thing i can think of is my use of mSceneMgr->clearScene() is somehow breaking it, becuase even if i remove all reference to the OgreAL::Sound file, it still falls over.

If anyone has any clues, ideas, advice, or even some half-baked theories, i'd love to hear them.

Thanks in advance.

Princess_Conecloon

20-06-2007 06:06:08

I'm having the same problem. Have you figured anything out? My states call clearScene() on exit, and since installing OgreAL, I get an assertion error.

EDIT: If I remove the call to clearScene(), everything runs smoothly, but if I delete OgreAL any time after the clearScene(), I get an error when OgreAL tries to clean all movable objects it created.

Any information on this would be greatly appreciated.