Jump to content
  • Advertisement
Sign in to follow this  
eal

ddraw flipping speed

This topic is 5039 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

On a game i made some time ago with ddraw (awol), instead of using page flipping, i just blt-ed everything to the back buffer, then blt-ed it to the primary surface. I know i shouldn't have used that method anyways since on some computers it runs really slow. so, is there a way to change the flip command to flip as fast as possible instead of locking to 60fps or whatever?

Share this post


Link to post
Share on other sites
Advertisement
There is no default mechanism that locks the flip framerate to 60 fps (or to any fps for that matter, EDIT: excluding that DDFLIP_WAIT pauses for the VRT interrupt -- see my post below). The framerate should only determined by how often you call the Flip routine. Note that flipping does NOT work for windowed programs where the entire display is not used and that double buffering MUST be used in these instances. Also, double buffering shouldn't be a significant slowdown, except perhaps on older machines where VRAM is scarce.

[Edited by - mnansgar on January 1, 2005 4:05:44 PM]

Share this post


Link to post
Share on other sites
hmm, if i do this:


source_rect.top=0;
source_rect.left=0;
source_rect.right=RES_X;
source_rect.bottom=RES_Y;

dest_rect.top=0;
dest_rect.left=0;
dest_rect.right=RES_X;
dest_rect.bottom=RES_Y;

lpddsprimary->Blt(
&dest_rect,
lpddsback,
&source_rect,
(DDBLT_WAIT),
NULL);


its alot faster than this:


FAILED(lpddsprimary->Flip(NULL,DDFLIP_WAIT));


it there any reason why this would happen? it seems like flipping takes along time.

Share this post


Link to post
Share on other sites
With DDFLIP_WAIT specified, the Flip() operation is not performed asynchronously. Thus, the video card will wait until the next vertical retrace before flipping the surface, and your code execution will pause until this is complete. On a monitor with 60 Hz refresh rate, then this means the flip will be delayed between 0 and 1/60 seconds before the operation is performed. Sorry I didn't mention this the first time :-P

See http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddover_42t3.asp

I should also mention that in both the double buffering and the page flipping, the MONITOR will still be refreshed at the same rate (probably at 60-72 Hz) -- the fps is simply how often the video memory is updated. In most cases, updating the video memory faster than your monitor refreshes through double buffering will cause tearing or flicker.

Share this post


Link to post
Share on other sites
thanks, time to re-release awol. i had tried the DDFLIP_NOWAIT before, but never DDFLIP_NOVSYNC

your rating++

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!