QA


Q&A

Q1:

Why doesn't Windows keep track of waves that weren't allowed to play because of interruption, and then play them as soon as it gets a chance?

A1:

Windows doesn't get into the business of tracking waves because it would be very difficult, if not impossible , to ever play them all when you consider that only one can play at a time. Additionally, sounds are often tied to program events that are time critical, which means that it wouldn't be very helpful to play the sound late. For example, if you were developing a military game and a bullet sound was postponed because an explosion sound was being played, it wouldn't really help for the bullet sound to be played later when the bullet might not even be on the screen anymore.

Q2:

Is it possible to prioritize waves so that only some waves are interrupted , while others are not?

A2:

Yes, but it works in the reverse. If you recall, when you play a wave, you indicate whether it can interrupt any other waves. So, instead of identifying a high-priority wave as not being able to be interrupted, you instead indicate that a high-priority wave has the ability to interrupt other waves. Practically speaking, this means that you can have two levels of priority for waves. Low-priority waves would use the SND_NOSTOP flag to indicate that they aren't allowed to interrupt other waves. On the other hand, high-priority waves would simply not use the SND_NOSTOP flag, which means that they will interrupt any currently playing wave.



Sams Teach Yourself Game Programming in 24 Hours
Sams Teach Yourself Game Programming in 24 Hours
ISBN: 067232461X
EAN: 2147483647
Year: 2002
Pages: 271

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net