View Single Post
Old 06-03-2010, 03:54 PM   #72
Jim Sachs
Developer
 
Jim Sachs's Avatar
 
Join Date: Dec 2000

Location: Southern Oregon
Posts: 9,774
Vermiculture subject moved here: https://www.feldoncentral.com/forums...257#post122257

Back on track - I believe I finally found a good way of limiting the frame rate accurately. Through a combination of the High Performance Timer and Sleep(), I seem to be able to maintain within 1 fps of the desired Frame Rate (of course, the upper limit would be the max which the machine can produce). Instead of setting the Sleep() number for a whole frame, I'm calling Sleep(1) multiple times within the same frame, until the desired amount of time is used up.

By the end of the day I hope to post v11j, which will include this code. It will be useful to have you guys with high-performance machines test it, as I'm limited to about 42 fps in full-screen mode. However, when I run it in a small window, I can max out at about 90 fps, and the Limit Frame Rate feature works very well in that case. At a limit of 60, I'm getting a pretty steady frame rate of between 59.5 and 60.02, with a CPU-usage of around 20%.
Jim Sachs
Creator of SereneScreen Aquarium
Jim Sachs is offline   Reply With Quote