SDL_Flip performance

The only way for SDL to get around the VSync problem is using the SDL_Flip. It works fine
except the performance is terrible. Seems to me that the driver uses polling method to detect
the Vertical retrace. It calls the kernel function too often so it eats up a lot of CPU time. Put the
SDL_Flip in a thread doesn’t help at all because it also slows down other tasks.

Does anyone have a better way to detect the Vertical retrace?

Isn’t there usually some kind of hardware irq for vsync?

Tony Wu wrote:> The only way for SDL to get around the VSync problem is using the

SDL_Flip. It works fine

except the performance is terrible. Seems to me that the driver uses
polling method to detect

the Vertical retrace. It calls the kernel function too often so it eats
up a lot of CPU time. Put the

SDL_Flip in a thread doesn’t help at all because it also slows down
other tasks.

Does anyone have a better way to detect the Vertical retrace?

Adam Gates wrote:

Isn’t there usually some kind of hardware irq for vsync?

Nothing that can be counted on to be there, no. Not on the X86 platform
anyway.