methods of vsync to avoid tearing?

Started by
0 comments, last by xor 18 years, 8 months ago
Hi, I'm trying to avoid tearing in my application and I want to ask about methods doing this. My app is using VMR custom allocator to display video content so this is very important. Also CPU usage should be as low as possible. 1. using D3DPRESENT_INTERVAL_DEFAULT or D3DPRESENT_INTERVAL_ONE but with this it is unable to use waiting time which leads to higher cpu usage than normal sleep with lower frame rates (is Present performs some empty loop while waiting for retrace?). 2. something like that: // rendering here D3DRASTER_STATUS rs; do { // sc is known m_pD3DDev->GetRasterStatus(sc, &rs); if (rs.InVBlank == FALSE) { // waiting here but how long??? } else break; } while (true); // present here BIG QUESTION: how long should I wait (sleep) for blank period to not miss, how to calculate this time? 3. double buffering??? I don't know nothing about that yet ;-) [EDIT] I see that I'm using double buffering, Present just filps back buffer with front buffer, right? Anyway, I have to wait for blank period with Present... Regards Piotr [Edited by - wozio on August 17, 2005 4:29:01 AM]
Advertisement
Double buffering

This topic is closed to new replies.

Advertisement