Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  GLUTWrapPointer?  (Read 1534 times)
0 Members and 2 Guests are viewing this topic.
Offline diskhub

JGO n00b
*

Posts: 4



« on: 2011-04-27 10:24:45 »

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?
Offline lhkbob

JGO Neuromancer
****

Posts: 1174
Medals: 35



« Reply #1 on: 2011-04-27 10:59:46 »

Use java.awt.Robot.mouseMove(x, y)

Offline diskhub

JGO n00b
*

Posts: 4



« Reply #2 on: 2011-04-27 11:28:19 »

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?
Games published by our own members! Go get 'em!
Offline lhkbob

JGO Neuromancer
****

Posts: 1174
Medals: 35



« Reply #3 on: 2011-04-27 11:44:55 »

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.

Offline gouessej

JGO Kernel
*****

Posts: 3558
Medals: 30


TUER


« Reply #4 on: 2011-04-28 04:46:52 »

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.

Julien Gouesse
Offline lhkbob

JGO Neuromancer
****

Posts: 1174
Medals: 35



« Reply #5 on: 2011-04-28 12:51:01 »

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.

Offline gouessej

JGO Kernel
*****

Posts: 3558
Medals: 30


TUER


« Reply #6 on: 2011-04-29 05:07:24 »

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.

Julien Gouesse
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.081 seconds with 20 queries.