Problem with getting cursor's position

Started by HideoKuze, January 24, 2019, 17:42:45

Previous topic - Next topic

HideoKuze

I am hoping for drawing the path of my cursor on the screen when I press mouse's left button. I do it by getting the position of cursor with
glfwSetCursorPosCallBack, and use glDrawPixel to draw the point on the screen. And the problem is when I move my mouse a little faster, the line become a series of dispersed point on my screen. It seems the frequency of the cursor's position fresh is too low. I wonder if someone can help me out, and I will be really appreciative.

https://paste.ubuntu.com/p/pMCKtZmTjH/

Here is my code for short, as you can see when you move your cursor fast, the delta of coordinate is really huge, and I want make the delta equals 1.0 on X or Y direction for each output.