aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/x11
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-03-27 12:27:57 +0100
committerSven Gothel <[email protected]>2013-03-27 12:27:57 +0100
commit9a4fcc7ea4ec61e4ceed791acced734ac04ea270 (patch)
tree257383c6954b5decb19f9fd0f9a27a24ca865dc1 /src/jogl/classes/jogamp/opengl/x11
parent83e9b0ce577e1a78eda20800f86cadcf90905141 (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/x11')
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index e38aabef8..8d1717e75 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -228,6 +228,22 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
+ public boolean isDeviceSupported(String connection) {
+ final boolean res;
+ final X11GraphicsDevice x11Device = new X11GraphicsDevice(X11Util.openDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
+ x11Device.lock();
+ try {
+ res = GLXUtil.isGLXAvailableOnServer(x11Device);
+ } finally {
+ x11Device.unlock();
+ }
+ if(DEBUG) {
+ System.err.println("GLX "+(res ? "is" : "not")+" available on device/server: "+x11Device);
+ }
+ return res;
+ }
+
+ @Override
public SharedResourceRunner.Resource createSharedResource(String connection) {
final X11GraphicsDevice sharedDevice = new X11GraphicsDevice(X11Util.openDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
sharedDevice.lock();