Windows: LWJGL didn't work well with jinput, but compatibility could be greatly improved if LWJGL used DirectInput 8 (like jinput). This can't be done unconditionally, since we need the DX3 support for older versions of windows. So, I've moved most Mouse and Keyboard stuff from native to java side and generalized DirectInput access through an abstract base class, with two concrete subclasses, one for dx3 and one for dx8.

This commit is contained in:
Elias Naur 2006-06-26 13:50:48 +00:00
parent e99b357a1b
commit 6cf49718db
33 changed files with 1972 additions and 894 deletions

View file

@ -513,10 +513,10 @@ final class LinuxDisplay implements DisplayImplementation {
}
private static native void nPollMouse(IntBuffer coord_buffer, ByteBuffer buttons);
public int readMouse(IntBuffer buffer, int buffer_position) {
public int readMouse(IntBuffer buffer) {
update();
lockAWT();
int count = nReadMouse(buffer, buffer_position);
int count = nReadMouse(buffer, buffer.position());
unlockAWT();
return count;
}
@ -616,10 +616,10 @@ final class LinuxDisplay implements DisplayImplementation {
}
private static native void nPollKeyboard(ByteBuffer keyDownBuffer);
public int readKeyboard(IntBuffer buffer, int buffer_position) {
public int readKeyboard(IntBuffer buffer) {
update();
lockAWT();
int count = nReadKeyboard(buffer, buffer_position);
int count = nReadKeyboard(buffer, buffer.position());
unlockAWT();
return count;
}