DirectDraw - limit frame rate

Started by
2 comments, last by BeanDog 24 years, 1 month ago
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?
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.
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.
try the flip function as
Primary->Flip(NULL, DDFLIP_WAIT)

i think that''s the vsync flag.
___________________________Freeware development:ruinedsoft.com

This topic is closed to new replies.

Advertisement