Monitor Frequency

BlueBear
04-25-2001, 03:05 AM
Hello everybody! This is my first post, hope the question is not too stupid and you can help me. I
started DirectX-Programming in VB a few weeks ago, my first try was to create a flicker-free 2D
animation. I did this using the DDBLT_WAIT flag with the blt-routines, but then I noticed that
different pc's with different graphic-cards have different refresh-rates (I really felt stupid when I
recognized this. I programmed something like this with my amiga when I was younger, of course
there was no problem, one monitor-frequency, no problem...)

The result is that my animation is running with different speed on different pc's. Then I tried to get
the monitor frequency with the help of the function DirectDraw7.GetMonitorFrequency(), this didn't
work, I got an error. I have really no idea why. My next try was to get it using the Surface
Description (setting the DDSCAPS_REFRESHRATE-flag, using DD.GetDisplayMode, then
DDSURFACEDESC2.lRefreshRate) but the only value I get is 0. I really have no idea what I made
wrong, has anybody experience with this topic?
Thanks for your help!

BlueBear

Matt Nash
05-03-2001, 04:29 AM
One way I've got around speed issues like this, is to test to see how fast the game runs (measure the time for about 100 frames).

You can then use this as a multiplier for the sprite movement.
For example, if your sprite moves 2 pixels per frame on your PC, it needs to move at 1 pixel per frame on one where the game runs twice as fast.

Hope this makes sense. I know it's not the exact solution you were after, but it may work if you can't find anything else.

Matt

BlueBear
05-03-2001, 05:33 AM
Thanks for your answer! You're right, this is not the best solution, but it's better than no solution

BlueBear

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum