diff options
author | Sven Gothel <[email protected]> | 2013-03-27 12:27:57 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-03-27 12:27:57 +0100 |
commit | 9a4fcc7ea4ec61e4ceed791acced734ac04ea270 (patch) | |
tree | 257383c6954b5decb19f9fd0f9a27a24ca865dc1 /src/jogl/classes/jogamp/opengl/SharedResourceRunner.java | |
parent | 83e9b0ce577e1a78eda20800f86cadcf90905141 (diff) |
SharedRessourceRunner: Add isDeviceSupported(..) query before spawn off thread, allowing a more gracefull detection of n/a GLX on X11
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/SharedResourceRunner.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/SharedResourceRunner.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java index a33e03a1a..7e050c81e 100644 --- a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java +++ b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java @@ -46,6 +46,12 @@ public class SharedResourceRunner implements Runnable { public static interface Implementation { /** * @param connection for creation a {@link AbstractGraphicsDevice} instance. + * @return <code>true</code> if the device supports all protocols required for the implementation, otherwise <code>false</code>. + */ + boolean isDeviceSupported(String connection); + + /** + * @param connection for creation a {@link AbstractGraphicsDevice} instance. * @return A new shared resource instance */ Resource createSharedResource(String connection); @@ -157,8 +163,10 @@ public class SharedResourceRunner implements Runnable { if (DEBUG) { System.err.println("SharedResourceRunner.getOrCreateShared() " + connection + ": trying - "+Thread.currentThread().getName()); } - doAndWait(connection, null); - sr = impl.mapGet(connection); + if ( impl.isDeviceSupported(connection) ) { + doAndWait(connection, null); + sr = impl.mapGet(connection); + } if (DEBUG) { System.err.println("SharedResourceRunner.getOrCreateShared() " + connection + ": "+ ( ( null != sr ) ? "success" : "failed" ) +" - "+Thread.currentThread().getName()); } |