From 200dd623c0374ace6179d534fa9dfeea6e9eb6de Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 14 Feb 2008 23:03:11 +0000 Subject: [PATCH] always call Sleep(0) at the end of each frame on Windows, I hope this 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vid_wgl.c b/vid_wgl.c index 88cc6814..603adbfc 100644 --- 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); } -- 2.39.2