Windows: Use data size constant for input devices instead of hard coded size
This commit is contained in:
parent
4e68c787b3
commit
6650e03ef4
|
@ -70,7 +70,7 @@ final class WindowsKeyboard {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
keyboard.acquire();
|
keyboard.acquire();
|
||||||
temp_data_buffer = BufferUtils.createIntBuffer(BUFFER_SIZE*2);
|
temp_data_buffer = BufferUtils.createIntBuffer(BUFFER_SIZE*WindowsDirectInputDevice.DATA_SIZE);
|
||||||
keyboard_state = BufferUtils.createByteBuffer(256);
|
keyboard_state = BufferUtils.createByteBuffer(256);
|
||||||
unicode_buffer = BufferUtils.createCharBuffer(BUFFER_SIZE);
|
unicode_buffer = BufferUtils.createCharBuffer(BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ final class WindowsMouse {
|
||||||
this.mouse_button_count = Math.min(enumerator.getButtonCount(), 4);
|
this.mouse_button_count = Math.min(enumerator.getButtonCount(), 4);
|
||||||
this.has_wheel = enumerator.hasWheel();
|
this.has_wheel = enumerator.hasWheel();
|
||||||
mouse_state = BufferUtils.createByteBuffer(3*4 + 4);
|
mouse_state = BufferUtils.createByteBuffer(3*4 + 4);
|
||||||
temp_data_buffer = BufferUtils.createIntBuffer(BUFFER_SIZE*2);
|
temp_data_buffer = BufferUtils.createIntBuffer(BUFFER_SIZE*WindowsDirectInputDevice.DATA_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasWheel() {
|
public boolean hasWheel() {
|
||||||
|
|
Loading…
Reference in New Issue