glutWarpPointer - Man Page

Moves the mouse pointer to given window coordinates.

Library

OpenGLUT - window

Synopsis

#include <openglut.h>

void
glutWarpPointer(int x, int y);

Parameters


x

Window X coord for mouse.


y

Window Y coord for mouse.

Description

glutWarpPointer() moves the mouse pointer to window-relative coordinates given by


x

and


y.

Caveats


x

and


y

are relative to current window.

Not applicable for


GLUT_OFFSCREEN

windows.

Warping means moving, just as if the user had manually moved the mouse. This can generate mouse-motion callbacks. If your callback then moves the pointer again, you may end up in an endless loop. There is some discussion about changing this, but at present this is just a caveat for you, the user, to be aware of.