From 4d6cbb4d1cd619aa2c05a186b2d2ba3697a48dd0 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 21 Jul 2006 20:35:27 +0000 Subject: [PATCH] Windows: Ingore DI_POLLEDDEVICE when setting buffer size of a directinput device --- src/java/org/lwjgl/opengl/WindowsDirectInput.java | 1 + src/java/org/lwjgl/opengl/WindowsDirectInputDevice.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/org/lwjgl/opengl/WindowsDirectInput.java b/src/java/org/lwjgl/opengl/WindowsDirectInput.java index ee1e56f2..aa219ef3 100644 --- a/src/java/org/lwjgl/opengl/WindowsDirectInput.java +++ b/src/java/org/lwjgl/opengl/WindowsDirectInput.java @@ -46,6 +46,7 @@ abstract class WindowsDirectInput { public final static int DI_OK = 0x00000000; public final static int DI_NOEFFECT = 0x00000001; public final static int DI_PROPNOEFFECT = 0x00000001; + public final static int DI_POLLEDDEVICE = 0x00000002; public final static int DI_DOWNLOADSKIPPED = 0x00000003; public final static int DI_EFFECTRESTARTED = 0x00000004; diff --git a/src/java/org/lwjgl/opengl/WindowsDirectInputDevice.java b/src/java/org/lwjgl/opengl/WindowsDirectInputDevice.java index 68b2ff71..05526686 100644 --- a/src/java/org/lwjgl/opengl/WindowsDirectInputDevice.java +++ b/src/java/org/lwjgl/opengl/WindowsDirectInputDevice.java @@ -94,7 +94,7 @@ abstract class WindowsDirectInputDevice { public void setBufferSize(int buffer_size) throws LWJGLException { int ret = setBufferSize(di_device, buffer_size); - if (ret != WindowsDirectInput.DI_OK) + if (ret != WindowsDirectInput.DI_OK && ret != WindowsDirectInput.DI_PROPNOEFFECT && ret != WindowsDirectInput.DI_POLLEDDEVICE) throw new LWJGLException("Failed to set buffer size (" + ret + ")"); int event_buffer_size = getEventSize()*buffer_size; event_buffer = BufferUtils.createByteBuffer(event_buffer_size);