Framethrottler version 2.
Changes Between Version 1 and Version 2:
I made version 2 because I believed I couldn't get the render timing right on version 1.
If your PC was slow, the processing thread caught up fine, but for some reason, the math on
delay before the next render call was always off, and you'd never get quite the right max frames rendered.
So I messed with it, trying to figure out the right timing code...I never found it.
Then I thought...hey. The processing timing code works fine. Why bother with anything
else?
So I remade it. The engine always calls the render function as many times as possible
now. This way, we don't have to worry about delaying before the next render update. And this
means you don't have to worry about not getting your max fps. You'll get whatever the computer
can give you.
The processing code has been revamped to allow frameskipping on the processing side.
It delays processing to skip a number of frames, then quickly catches up on all the processing.
This gives you rock solid timing. Now...if your input is time-specific, you might miss a press of
a keyboard key while frame skipping, but it's nothing game-breaking at all, I don't think.
Also, I took away frameskip types, since the engine now automatically maintains the
needed fps, and does any skipping you tell it to.
This new approach also seriously cut down on the size of the function and the number
of tracking variables I needed.
Also, I COULD upload this to useful VC demos, if anybody's interested.