Incorrect coordinate delta on first Mouse.getEventDX/Y event

Started by Riven, April 06, 2013, 13:20:27

Previous topic - Next topic

Riven

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.

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


On a 1024x768 window:
// 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.