diff options
author | Sven Gothel <sgothel@jausoft.com> | 2012-02-25 19:21:43 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2012-02-25 19:21:43 +0100 |
commit | aee3a75ad87ef3da0652c6b917ccdfda63a1230d (patch) | |
tree | 087637968ca3e1a6bf81a92e7dfaaef2cceb9ada /src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java | |
parent | 9db2d90e5398e7b2abe45f0799a9d00729575b49 (diff) |
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
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java | 25 |
1 files changed, 14 insertions, 11 deletions
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 |