LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: g4m0r on July 31, 2011, 18:20:34

Title: Mouse cursor in grabbed mode
Post by: g4m0r on July 31, 2011, 18:20:34
Hello,

I have a problem:
I have a first person camera coded.
I want to have a cursor in the middle of the screen.

I have the setGrabbed(true), to get the mouse delta's (getDX(), getDY() ).
When I do setGrabbed(false), I do not get mouse delta's....

How can I fix that problem??
And how Can I then avoid the cursor flickering when I set the cursor every time to the screen middle position?

Title: Re: Mouse cursor in grabbed mode
Post by: CodeBunny on August 01, 2011, 11:36:34
One thing to recommend:

Use a texture for the aiming reticule, not the mouse cursor! You won't get the jumpy behavior of the mouse, and since you can simply have the aiming mark be a textured quad, you have much more control over how it's rendered. Plus, you do not have size restrictions.
Title: Re: Mouse cursor in grabbed mode
Post by: g4m0r on August 02, 2011, 10:58:45
Hi,

ok, thanks for your recommendation.

regards,
g4m0r