aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorelias <[email protected]>2006-08-23 07:53:04 +0000
committerelias <[email protected]>2006-08-23 07:53:04 +0000
commit4ff1e85521b53e0cde2e21c671c6b0a2a8664a93 (patch)
treec1cb9327f3a19edc4cf89afad35fb0f92c7d6611 /plugins
parentc126186f7bb604961ed6b3fd73715c31a289e41e (diff)
DirectInput: Don't fail entire enumeration because of one device failure
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@164 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins')
-rw-r--r--plugins/windows/src/java/net/java/games/input/IDirectInput.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/windows/src/java/net/java/games/input/IDirectInput.java b/plugins/windows/src/java/net/java/games/input/IDirectInput.java
index 8cef150..dea99d5 100644
--- a/plugins/windows/src/java/net/java/games/input/IDirectInput.java
+++ b/plugins/windows/src/java/net/java/games/input/IDirectInput.java
@@ -78,7 +78,12 @@ final class IDirectInput {
* native side will clean up in case of an exception
*/
private final void addDevice(long address, byte[] instance_guid, byte[] product_guid, int dev_type, int dev_subtype, String instance_name, String product_name) throws IOException {
- devices.add(new IDirectInputDevice(window, address, instance_guid, product_guid, dev_type, dev_subtype, instance_name, product_name));
+ try {
+ IDirectInputDevice device = new IDirectInputDevice(window, address, instance_guid, product_guid, dev_type, dev_subtype, instance_name, product_name);
+ devices.add(device);
+ } catch (IOException e) {
+ DefaultControllerEnvironment.logln("Failed to initialize device " + product_name + " because of: " + e);
+ }
}
public final void releaseDevices() {