If you have no thread objects you can use (and you probably don't), you can just do what game programmers used to do (especially for console games).
You will undoubtedly have a main loop where you poll for input and render each frame of your game animation. Well, instead of timing your sounds to last a certain amount of time, time your sounds to last a certain number of game loop iterations. If your game runs smoothly, these two things will be equivalent. If not, well, your game didn't run smoothly anyways, so who's surprised that the sound was off?
Anyway, you sound rather new to programming, so good luck!
Last edited by KnifeMissile; 05-25-2004 at 10:45 AM..
|