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
Then, in the settup section of the GDD.cpp
So far, fine.
So, to start the background music we have this in the FrameStart function
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
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.
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.