LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Qudus on May 07, 2009, 17:33:03

Title: Mouse coordinates incorrect
Post by: Qudus on May 07, 2009, 17:33:03
hi

I found a bug in the input API. The mouse y coordinate is incorrectly read. If you click into the opengl window at the topmost line ( y-resolution - 1 ) is read on Windows and ( y-resolution - 3 ) is read on Linux (KDE 3.5). If you click on the bottom most line, 3 is read on Linux, while this value is correct (0) on Windows.

The x-coordinate seems to be correct.

Marvin
Title: Re: Mouse coordinates incorrect
Post by: Qudus on May 10, 2009, 14:21:03
I this bug being invested? I just want to know, if I am ignored.

Marvin
Title: Re: Mouse coordinates incorrect
Post by: Matzon on May 11, 2009, 17:50:33
fwiw, I dont have a proper linux setup - especially not KDE - its not ignored by me, its just that linux users are probably more relevant in fixing/investigating this issue ...
Title: Re: Mouse coordinates incorrect
Post by: ryanm on May 11, 2009, 19:27:48
Just had a check here on KDE 4.2 and everything works as expected. Y-value ranges from 0 to height-1.
Title: Re: Mouse coordinates incorrect
Post by: Ciardhubh on May 11, 2009, 20:04:45
I just checked on Ubuntu 8.04 (Gnome not KDE) and it works as expected, i.e. Y ranges from 0 to resolution - 1. We are talking about Mouse.getY(), are we?
Title: Re: Mouse coordinates incorrect
Post by: Qudus on May 11, 2009, 20:35:54
I was talking about getEventY() IIRC.

Quote from: Matzon on May 11, 2009, 17:50:33
its not ignored by me, its just that linux users are probably more relevant in fixing/investigating this issue ...

Then it would have been nice, if you would have just told me about that. But thanks anyway for your reply.

Marvin
Title: Re: Mouse coordinates incorrect
Post by: Ciardhubh on May 11, 2009, 21:43:59
Quote from: Qudus on May 11, 2009, 20:35:54
I was talking about getEventY() IIRC.

Just tried that too and it also returns the same correct results for me (Ubuntu/Gnome). I tried 1280*960 and 800*600 with up to date Nvidia drivers.
Title: Re: Mouse coordinates incorrect
Post by: Qudus on May 12, 2009, 01:36:42
I used 800x600 Windowed mode (decorated) on a 1680x1200 desktop. I use up to date ATI drivers (as far as the OpenSuSE updater provides updates from the ATI repository).

Looks like this is a problem on my system only.

Marvin
Title: Re: Mouse coordinates incorrect
Post by: Ciardhubh on May 12, 2009, 07:23:32
Quote from: Qudus on May 12, 2009, 01:36:42
... on a 1680x1200 desktop. I use up to date ATI drivers ...

ATIIIIIIIIIIIIII! *twitch*

Anyway, maybe your mouse driver resolution isn't high enough to hit the last few pixels on such a high resolution desktop?

Did you poll all events with Mouse.next()? Maybe you are reading the previous event?

The only unexpected behaviour I found was, if I chose a resolution equal to or greater than my desktop in windowed mode, it automatically scales the OpenGL surface to fit the window on screen.
Title: Re: Mouse coordinates incorrect
Post by: Qudus on May 12, 2009, 10:58:32
Quote from: Ciardhubh on May 12, 2009, 07:23:32
ATIIIIIIIIIIIIII! *twitch*

Yes. ATI is cool :).

Quote from: Ciardhubh on May 12, 2009, 07:23:32
Anyway, maybe your mouse driver resolution isn't high enough to hit the last few pixels on such a high resolution desktop?

I never thought about that. Maybe possible. I will see, if I can try a better mouse.

Quote from: Ciardhubh on May 12, 2009, 07:23:32
Did you poll all events with Mouse.next()? Maybe you are reading the previous event?

Yes. Here is my code:
http://jagatoo.svn.sourceforge.net/viewvc/jagatoo/trunk/src/org/jagatoo/input/impl/lwjgl/LWJGLMouse.java?view=markup

Marvin