Hello Guest

Incorrect coordinate delta on first Mouse.getEventDX/Y event

  • 0 Replies
  • 3383 Views
*

Offline Riven

  • *
  • 15
On my system (Windows 7), the first mouse-delta values I receive through the event API, seem to be values relative to (0,0), meaning that upon the first mouse-move event, Mouse.getEventDX/Y effectively return the absolute mouse coordinate, from the lower left corner.

Code: [Select]
while (Mouse.next()) {
int mouseDX = Mouse.getEventDX();
int mouseDY = Mouse.getEventDY();
System.out.println("dx: "+mouseDX+", dy: "+mouseDY);
}

On a 1024x768 window:
Code: [Select]
// entering the window from the bottom-right:
dx: 1011, dy: 32
dx: -2, 0
dx: -5, 2

// entering the window from the top-left:
dx: 45, dy: 740
dx: 3, dy: -6
dx: 4, dy: -4

It's easy enough to 'skip' this first event in my own code, but I think LWJGL should handle this logic behind the scenes.
« Last Edit: April 06, 2013, 13:25:15 by Riven »