From aee3a75ad87ef3da0652c6b917ccdfda63a1230d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 25 Feb 2012 19:21:43 +0100 Subject: X11: Fix unavailable GLX (Server): Use fallback GraphicsConfigurationFactory (X11GLX -> X11) - GraphicsConfigurationFactory.registerFactory(..) returns previous mapped GraphicsConfigurationFactory. This allows daisy chaining of GraphicsConfigurationFactory, in case one is not suitable. - X11GLXGraphicsConfigurationFactory: - Store the previously mapped factory as fallback - choose*Impl(): If GLX is not available, use fallback --- .../classes/jogamp/opengl/x11/glx/GLXUtil.java | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java') diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java index 8b90d6887..7d03bbb88 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java @@ -43,6 +43,20 @@ import com.jogamp.common.util.VersionNumber; public class GLXUtil { public static final boolean DEBUG = Debug.debug("GLXUtil"); + public static synchronized boolean isGLXAvailableOnServer(X11GraphicsDevice x11Device) { + if(null == x11Device) { + throw new IllegalArgumentException("null X11GraphicsDevice"); + } + if(0 == x11Device.getHandle()) { + throw new IllegalArgumentException("null X11GraphicsDevice display handle"); + } + boolean glXAvailable = false; + try { + glXAvailable = GLX.glXQueryExtension(x11Device.getHandle(), null, 0, null, 0); + } catch (Throwable t) { /* n/a */ } + return glXAvailable; + } + public static VersionNumber getGLXServerVersionNumber(long display) { int[] major = new int[1]; int[] minor = new int[1]; @@ -92,17 +106,6 @@ public class GLXUtil { return clientVersionNumber; } - public static synchronized boolean isGLXAvailable(long handle) { - if(0 == handle) { - throw new IllegalArgumentException("null X11 display handle"); - } - boolean glXAvailable = false; - try { - glXAvailable = GLX.glXQueryExtension(handle, null, 0, null, 0); - } catch (Throwable t) { /* n/a */ } - return glXAvailable; - } - public static synchronized void initGLXClientDataSingleton(X11GraphicsDevice x11Device) { if(null != clientVendorName) { return; // already initialized -- cgit v1.2.3