View Single Post
Old 10-30-2002, 04:39 PM   #8
flipper
Registered
 
Join Date: Mar 2002

Location: Texas
Posts: 60
Jim, the app just needs to give up the cpu for a millisecond or two. the OS will then allow a context change to the next cpu-intensive app, if there is one, or just idle if there isn't. there are a few ways to make that happen. Sleep and WaitForSingleObject calls for Windows come to mind off-hand. you can use Sleep if the "next frame to be displayed" calculation is time-based. WaitForSingleObject is used in a DirectX 8 SDK sample called DM Boids. the app uses it to sync the video with the audio and as a result of the WaitForSingleObject call the cpu usage goes from 100% to just a few percent, depending upon your system of course.
flipper is offline   Reply With Quote