DirectDraw timing (best found-queryperformancecounter !)

From my previous post, the header files for doing 64-bit

math is in LARGEINT.H, and you can use the

queryperformancecounter function to get rock solid

timing for your flips. It really does work - like clockwork.

I made several measurements, and it turns out that the

difference in time interval to actually draw the screen

varies by a factor of 2 - this MUST be due to whatever

windows is doing, I think, because sometimes I hear

my hard drive arm dance around, and there should be

no reason for this. So, you can zero out an 800X600 screen

at 256 colors in about half of a 20 frames per second

interval. That gives you a little time to redraw if your code

is really fast (I am using a cyrix 233 mmx pro). The good

news is that the queryperformancecounter function takes

out all the variable slop from windows timing - and you get

a rock solid frame refresh rate that is a delight to watch.

I am going to do a comparison of this method against

vesa 2.0 page flipping in both DOS extended mode,

and also DOS realmode with g-bit set high - if I can figure

out how to code these altenate ways. I HAVE TO KNOW

for sure that windows isn't slowing down my animation.

I'll post results for those interested when I'm done.

Jerry Burnett


Comments

  • : The good

    : news is that the queryperformancecounter function takes

    : out all the variable slop from windows timing - and you get

    : a rock solid frame refresh rate that is a delight to watch.

    : I am going to do a comparison of this method against

    : vesa 2.0 page flipping in both DOS extended mode,

    : and also DOS realmode with g-bit set high - if I can figure

    : out how to code these altenate ways. I HAVE TO KNOW

    : for sure that windows isn't slowing down my animation.

    : I'll post results for those interested when I'm done.


    DOS real-mode??!? Yikes. :)


    But of course we KNOW that Windows does slow down our animation to varying degrees. The thing is that since DirectX uses the hardware, it SHOULD more than make up that speed in most cases (if used correctly, even though its too easy to use it incorrectly). If you were to use a software blitter under Windows, than a DOS version would be quite a bit faster.


    I actually have a problem with my Window's version where it skips 10+ frames at one time. It always happens at a given time into my level (give of take about 5 secs), but I can't track it to anything but Windows (it isn't in my code anyway). I don't touch the hard-drive or allocate any memory during a level, but yet Windows goes and reads the drive for whatever reason, at about the same time into each level?!?! I assumed it was my music API probably spooling data from the disk, but I removed it and I still get the frame skip. The only culprit left is Windows, and I have no idea how to stop it. (Can I change the program's priority without using MFC?).


    Rock


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories