31
Graphics / Re: sf::Image::loadFromFile test case
« on: July 06, 2012, 07:40:07 pm »
I think he's just pointing out that some people do use 8-bit png.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Hmm, guess i should just add that error class as a member instead of inheriting...I think I'd recommend this... why on earth are you inheriting from error anyway?
- I want to play a music, and automatically starts a new music when this one is done. Is there a way to know when the streamed music is about to end ? Like a callback or something ?I think you'd have to periodically (perhaps at the end of your main loop, or in other thread) checking to see that the music is still playing.
- I want to play a sound everytime someone shoots. So one SoundBuffer for all of them, but how do I dynamically create the Sound objects ? Do I need to keep a list of all active sounds, and delete them when they're finished ? Is there some auto-delete flag ?In order to avoid having to check if a sound is finished, I used a boost::circular_buffer rather than a queue as Nexus recommended. It does mean that sounds may be cut off occasionally, and it limits how many sounds you can play at once, but depending on your needs it may be sufficient. If you expect to have more then ten or twenty sounds simultaneously, though, it's probably more space-efficient to go with a non-fixed-size container like the queue.