Jump to content
  • Advertisement

Archived

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

BeanDog

DirectDraw - limit frame rate

This topic is 6788 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 think my brother messed with my code. I had my game working fine, but somehow my game is no longer limited to the refresh rate for frame rate. I am using DX7.0a. How do you limit that?

Share this post


Link to post
Share on other sites
Advertisement
when using flip remove DDFLIP_NOVSYNC. If that is not your problem, then try looking at the millions of posts(about last week) about DDraw/DSound on framerate problems.

Share this post


Link to post
Share on other sites
void FlipMain(LPDIRECTDRAWSURFACE7 &Primary)
{
HRESULT ddrval;
while(1)
{
ddrval = Primary->Flip(NULL, 0);
if(ddrval == DD_OK)
{
break;
}
if(ddrval == DDERR_SURFACELOST)
{
ddrval = Primary->Restore();
if(ddrval != DD_OK)
{
break;
}
}
if(ddrval != DDERR_WASSTILLDRAWING)
{
break;
}
}
}
Here''s the code. Check it out.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!