Reputation: 7544
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.
Upvotes: 3
Views: 3972
Reputation: 7544
I've just found it, you just have to ask the right question and google helps :D
Its glutWarpPointer(middleX, middleY)
;
Upvotes: 5
Reputation: 14788
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.
Upvotes: 1