You only need to execute SDL_SetRelativeMouseMode once, at the startup of the program/game, and not every frame. As long as the mode isnāt changed again, the mode will stay as it is.
I donāt know if the continuously call of SDL_SetRelativeMouseMode will cause the lag etc, but it might be worth checking it out.
I only call SDL_SetRelativeMouseMode once when I transition into game play.
Yesterday I added a command line option to disable this call and it fixed the problem for those players. So thereās definitely something wrong with this call.
Hereās the thread where the problem is explained:
Googling suggests this is a bug in an Xinput driver, fwiw.
(the beeping is, if I recall correctly, a Windows thing that means āthe input queue for the mouse is full and not being emptied fast enough,ā which tends to mean some kernel-level driver is hanging for whatever reason.)
SDL_SetRelativeMouseMode on Windows calls RegisterRawInputDevices() to get mouse input outside of the usual Windows mouse events. I donāt know why it would cause this specific bug, but I could see it tickling parts of the system that might.