summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl
diff options
context:
space:
mode:
authorMartin Hegedus <[email protected]>2013-04-02 09:31:41 -0700
committerSven Gothel <[email protected]>2013-04-15 15:46:47 +0200
commit5b47372590ec715647ebbd75d70c41ec7a64485a (patch)
tree662ebf0af203cf10a48f66cb9777cf8e9400da6b /src/jogl/classes/jogamp/opengl
parent9104faa11c256cbe8687122bba3c54dbb398b4e0 (diff)
Fix Bug 705 - Make Mesa X11 driver < 8.0 use new Quirk DontCloseX11DisplayConnection
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 9f7c9cf57..74bc59c7c 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -1562,9 +1562,41 @@ public abstract class GLContextImpl extends GLContext {
quirks[i++] = quirk;
}
}
+
+ //
+ // Mesa RENDERER related quirks
+ //
+ if( glRendererLowerCase.contains("mesa") ) {
+ // Added March 30, 2013
+ // Martin C. Hegedus
+ if ( glRendererLowerCase.contains("x11") && getMesaMajorVersion(glVersion) < 8.0 ) {
+ final int quirk = GLRendererQuirks.DontCloseX11DisplayConnection;
+ if(DEBUG) {
+ System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: Mesa X11 < 8 : Renderer=" + glRenderer + ", Version=" +glVersion);
+ }
+ quirks[i++] = quirk;
+ }
+ }
glRendererQuirks = new GLRendererQuirks(quirks, 0, i);
}
+
+ // Added by Martin C. Hegedus, March 30, 2013
+ private static final int getMesaMajorVersion(String version) {
+ if (version == null || version.length() <= 0) return -1;
+ String[] strings = version.trim().split("\\s+");
+ if (strings.length <= 0) return -1;
+ version = strings[strings.length-1];
+ int index = version.indexOf(".");
+ if (index == 0) return -1;
+ if (index != -1) version = version.substring(0,index);
+ try {
+ Integer iNumber = new Integer(version);
+ return (iNumber == null) ? -1 : iNumber.intValue();
+ } catch (Throwable t) {
+ return -1;
+ }
+ }
private static final boolean hasFBOImpl(int major, int ctp, ExtensionAvailabilityCache extCache) {