Originally Posted by brebs
This patch seems to work, to force vsync on in wine 1.4
Sure, this one should work, and it would force vsync on both for OpenGL and direct3d apps under wine. As you had hardcoded swap_interval == 1 into the WGL_EXT_swap_control implementation there's no point in hardcoding it inside wined3d.
With the hardcode approach you've got a bug here: WGL offers a way to read back current swap_interval, and Wine implements it internally inside X11DRV_wglGetSwapIntervalEXT(), tracking the value being set inside swap_interval variable. In case an app requests swap_interval != 1 and then reads back it using wglGetSwapIntervalEXT() - it would read back the value it had previously being set, i.e. with your patch Wine essentially lies to the app about real vsync state. That's a bad thing cause some apps have got built-in detection for the driver ability to set swap_interval, and might then base their timing on an assumption that having swap_control == 0 the execution wouldn't be "paused" as every swap buffers call - which is not the case. If you happen to hit such an app - you would get huge input lags problems. So, the solution is either to hardcode 1 as the return value for wglGetSwapIntervalEXT() or to add line "interval = 1;" just prior the line "wine_tsx11_lock();" inside X11DRV_wglSwapIntervalEXT(). Well, enough of this programming stuff, it's a bit offtopic in this thread actually :-).