Hi all,
I wish to use Glut.glutwrappointer but i don’t seem to be able to find this method in Jogl glut library.
Can I know how do you set the cursor to the centre of my Jogl frame window?
Use java.awt.Robot.mouseMove(x, y)
I tried that.
But i thought the results are dfferent.
Thought GLUTWrapppointer just set the cursor to the center without actually moving the mouse… Can u confirm that they serve the same purpose?
They both move the mouse cursor. I know Robot generates a low-level mouse event when this happens. I’m assuming that glutWarpPointer does the same thing. Either way, if JOGL’s GLUT doesn’t have glutWarpPointer, then Robot is the only option I know of that lets you reposition the cursor in pure Java.
If you’re using LWJGL, they have their own native mouse support that lets you set the cursor position, too.
Hi
glutWarpPointer is buggy anyway, I had to use win32 API on Windows (in 2006) to fix that whereas it worked correctly on Linux. JOGL has its own native mouse support in NEWT, an equivalent of glutWarpPointer is going to be implemented in this API. You can already use AWT Robot if you use JOGL with AWT as lhkbob suggested.
As long as you’re fine with importing AWT, you can use Robot anywhere, even if you’re using LWJGL or NEWT for the other native mouse handling. Robot just moves the mouse and doesn’t require a window to work within, or anything like that.
Ok but in a (near?) future, it will be necessary to remove any AWT dependency to benefit of an excellent cold startup time with the plugin 3, that is why we have to keep in mind other options.