Original Post
i''ve had this idea in my head for about 2 days and i just wanted to know whether it would work or not
i''m new to threads and all but i think i have a generall idea about what they are
lets say your monitor refreshes at 60hz, that means in ddraw the most fps you can get is 60fps unless you don''t wait for vertical retrace. That means you can at most show a frame every 16ms.
lets say all your calculations take about 16 ms to do
this means that at best you''ll show the frame in 16ms (60fps) and at worst 32 ms (30fps)
like this:
fliping 5ms (this will take 0 to 16 ms to do depending on where
fliping 5ms the vertical trace is when you start)
fliping 5ms <- keeps on doing this for a total of 32ms
calc''ing 5ms
calc''ing 5ms
calc''ing 5ms
draw to back buffer
if you had 2 threads, one for flipping only, and one for calculations only, then why can''t you do this.
fliping 5ms calcing (for next frame)
fliping 5ms calcing
fliping 5ms calcing
draw to backbuffer (in calcing thread)
so that this way you get closer to an average of 60 fps. i''m sure this doesn''t work, or people would do it. can somebody tell whats wrong with this or what?