]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
always call Sleep(0) at the end of each frame on Windows, I hope this
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 14 Feb 2008 23:03:11 +0000 (23:03 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 14 Feb 2008 23:03:11 +0000 (23:03 +0000)
fixes problems with Logitech input drivers freezing the game for 50+
milliseconds every 3 seconds or so, and has no harm to framerate in
testing

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8097 d7cf8633-e32d-0410-b094-e92efae38249

vid_wgl.c

index 88cc6814fa86a398ffc597527827e271902c17f1..603adbfcfa273d476889c545268947113dbb28d9 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -267,6 +267,11 @@ void VID_Finish (qboolean allowmousegrab)
                SwapBuffers(baseDC);
        }
 
+       // make sure a context switch can happen every frame - Logitech drivers
+       // input drivers sometimes eat cpu time every 3 seconds or lag badly
+       // without this help
+       Sleep(0);
+
        VID_UpdateGamma(false, 256);
 }