• Advertisement

Archived

This topic is now archived and is closed to further replies.

Limiting framerate in DirectDraw

This topic is 5809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a problem with DirectDraw. I use the QueryPerformanceCounter() function to limit the framerate, but the scrolling looks more like "jumping" than scrolling. can anyone help me??

Share this post


Link to post
Share on other sites
Advertisement
How are you limiting the framerate? Are you defining your animations in terms of time (i.e. units per sec), or are you using Andre LaMothe''s (terrible) method of waiting at the end of the game loop for a certain amount of time to pass?

Share this post


Link to post
Share on other sites
I use this function:

void LimitFrameRate(void)
{
do
{
QueryPerformanceCounter(&now);

passed = now.QuadPart - last.QuadPart;

framerate = double(Frequenz.QuadPart) / double(passed);
}
while(framerate > FRAMERATE); // FRAMERATE = 60

QueryPerformanceCounter(&last);
}

Share this post


Link to post
Share on other sites

  • Advertisement