If I use a seperate thread for updating
Will It leads to strange output?
As I have heard that in games we can use multiple threads for handling graphics updatse, Phyiscs updates, Sound updates and AI updates.
I need your opinian.
If yes do you think how much frame rate is hould keep for mSoundManager updates.
If your using the BOOST version of the lib ( OGGSOUND_THREADED= 1 ), which is the default, then the sound is already using multiple threads, you would still call SoundManager->update() in your main update function though, as all that function is doing is propogating any positional changes from the scenegraph to the sounds.
Unless you have lots of sounds, you probably won't notice any significant change in framerate, but you will benfit from the non-blocking feature of many of the audio function calls, meaning your app can carry on doing what it needs to. Also you'll be able to play audio in the background whilst loading scenes for example.
but you will benfit from the non-blocking feature of many of the audio function calls, meaning your app can carry on doing what it needs to. Also you'll be able to play audio in the background whilst loading scenes for example.
Threaded version seems to be the best choice. I would go for it.
One more question
I really don't know about the BOOST threads. I can remember that I got an error while I am compiling with OGGSOUND_THREADED= 1.
So If I use separate threads is that OK?
Thanx for your support
I'd highly recommend using the threaded version of the library, read this topic about setting up with BOOST: viewtopic.php?f=19&t=8389
Any problems just post a query.
The boost download that you have recommended http://www.boost-consulting.com/boost_1_34_1_setup.exe
does not have
boost::this_thread or boost::posix_time
so it throw exception at this line
boost::this_thread::sleep(boost::posix_time::millisec(10)); in threadUpdate() function
Is this the patch?
static void threadUpdate()
struct boost::xtime timeout;
timeout.sec = 0;
timeout.nsec = 10;
It just compiles without errors. seems OK for me.
EDIT : I have used the svn trunk
EDIT : No above won't be the patch. application is too damn slow
. Still I need to know what's wrong with boost::this_thread or boost::posix_time
You could replace the boost sleep with windows Sleep(), otherwise use BOOST 1.38/1.40 and download thread and date_time and it should compile fine, I use 1.40 presently.