Jump to content
  • Advertisement

Archived

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

elmo

vsync yes or no???

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

hello! i use ddraw primary and an attached surface so i can draw always on the backsurface and than i use ... while(lpddsprimary->Flip(NULL,DDFLIP_WAIT)!=DD_OK); someone told me that i doesnt use a vsync wait vefor flipping because directx does it for me. BUT... now ihave a new monitor device (100Mhz), and now the scrolling an animation of the game are flickering and there are not smooth...like it was befor! also the game runs faster! normaly when i think back on my amiga days i always must use vsync to get a smooth scrolling/animation... so whats up with this probl. thanks for any help elmo

Share this post


Link to post
Share on other sites
Advertisement
You should let the end user enable/disable vsync as they like, because it''s different on different systems. My computer has always run fine without it, but some don''t.

DDFLIP_WAIT is just to prevent errors if the hardware is busy, it doesn''t wait for vsync.

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown

Share this post


Link to post
Share on other sites
The whole idea with the Flip function and double buffering is to prevent flickering. DirectDraw should wait for the VSync signal to be triggered but if it don''t work, try to use the VSync waiting function that lies in the DirectDraw interface. I think it''s called WaitForSync or something like that.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Oh, just one more thing. You don''t have to use a while statement if you are using the DD_FLIPWAIT flag.

Share this post


Link to post
Share on other sites
The wait flag is nothing to do with vsync. If you don''t wait, flip will fail if it can''t flip immediately. If you wait, it will wait until it can.

Microsoft''s opinion is that vsync must always be enabled. Any driver that allows you to turn vsync off cannot gain certification. Which is why most drivers require registry hacks.

TheTwistedOne
http://www.angrycake.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Actually, that''s not quite true. If you are using DX7 there is an option _NOT_ to wait for vsync. DDFLIP_NOVSYNC. or someting.
just a little fact.

Share this post


Link to post
Share on other sites
hi
in lamothe´s book they use always this way:

// wait for vsync
lpdd->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN,0);

and than...

// surface flippen
lpddsprimary->Flip(NULL,DDFLIP_WAIT);

ok this runs fine on most machines, but now i got a new monitor (85mhz and higher) and nothing looks like befor...
the grafiks are jumping, but over the full screen in the same way and distance...

i have turned off the vsync wait and insert the following

LastTime = timeGetTime();
while ((timeGetTime () - LastTime) < 1)
{
// waiting
}

and than all looks good... my game runs now with 75 frames, but i dont no why, and this is very stupid... so what is the best way to do a smooth scrolling and animation ?????
ON ALL MACHINES?? and not only on my PIII500 TNT2/32MB

thanks for all
elmo

Share this post


Link to post
Share on other sites
Actually, that''s not quite true. If you are using DX7 there is an option _NOT_ to wait for vsync. DDFLIP_NOVSYNC

Really? Bah, you can always rely on Microsoft to do complete u-turns.

TheTwistedOne
http://www.angrycake.com

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!