When i make my program to use only 0-2% cpu (removed some CPU intensive opengl function), my mouse coordinates starts to lag! and when i use 100% CPU (when enabling the opengl function) i get nice and smooth mouse coordinates, note that the opengl function does nothing to my mouse coordinates. look at below image i recorded my rotation function values by using mouse coordinates:
This is with 100% cpu usage (as it should look):
-
This is with 2% cpu usage:
It is really annoying problem, because i am using mouse cursor position to change the rotation angle, and with the above image case, it looks really laggy rotation.
I might be able to make own interpolation or something, but i want to know what is causing this and how to fix it.
Im getting mouse coordinates with WM_MOUSEMOVE message and i also tried to use GetCursorPos() on every frame before my rotation code, but it has no difference.
Edit: I noticed that the CPU usage doesnt have to be 100% to get smooth, but the CPU just needs to be "waken up" and then it stays smooth even with low CPU usage.