Question

Is there a function in glut which moves the mouse to a specific position? There is a similar function in SDL (SDL_WarpMouse) but I want to stick to glut.

Was it helpful?

Solution

I've just found it, you just have to ask the right question and google helps :D

Its glutWarpPointer(middleX, middleY);

OTHER TIPS

Unless you also hide the pointer this will be very ugly. I used this once for a class project and it did the trick but it looked horrible. but then again I was using it to emulate purely relative mouse movements (basically so it couldn't leave the window). But other than that, yeah, it does the job.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top