How to get current mouse position in C ++ / OpenGL?

I know that I can use the Mouse callback function when the user clicks on the mouse, but what if I want to know the current x / y position without clicking the user?

Will I have to use another callback that gets called with any mouse movement and tracks x / y itself, or is there a function that I can call in GLUT / OpenGL to get it?

+3
source share
2 answers

Register glutPassiveMotionFunc callback function

See information about callbacks

+9
source

glutMotionFunc/glutPassiveMotionFunc .

7.6 glutMotionFunc, glutPassiveMotionFunc

+4

Source: https://habr.com/ru/post/1703057/


All Articles