aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classes/com/sun/opengl/impl/FunctionAvailabilityCache.java29
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/MacOSXGLContext.java6
2 files changed, 32 insertions, 3 deletions
diff --git a/src/classes/com/sun/opengl/impl/FunctionAvailabilityCache.java b/src/classes/com/sun/opengl/impl/FunctionAvailabilityCache.java
index 754e1d918..83d528648 100644
--- a/src/classes/com/sun/opengl/impl/FunctionAvailabilityCache.java
+++ b/src/classes/com/sun/opengl/impl/FunctionAvailabilityCache.java
@@ -41,6 +41,7 @@ package com.sun.opengl.impl;
import javax.media.opengl.*;
import java.util.*;
+import java.util.regex.*;
import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.GraphicsConfiguration;
@@ -310,12 +311,36 @@ public final class FunctionAvailabilityCache {
StringTokenizer tok = new StringTokenizer(versionString, ". ");
major = Integer.valueOf(tok.nextToken()).intValue();
minor = Integer.valueOf(tok.nextToken()).intValue();
+
+ // See if there's version-specific information which might
+ // imply a more recent OpenGL version
+ tok = new StringTokenizer(versionString, " ");
+ if (tok.hasMoreTokens()) {
+ tok.nextToken();
+ if (tok.hasMoreTokens()) {
+ Pattern p = Pattern.compile("\\D*(\\d+)\\.(\\d+)\\.?(\\d*).*");
+ Matcher m = p.matcher(tok.nextToken());
+ if (m.matches()) {
+ int altMajor = Integer.valueOf(m.group(1)).intValue();
+ int altMinor = Integer.valueOf(m.group(2)).intValue();
+ // Avoid possibly confusing situations by requiring
+ // major version to match
+ if (altMajor == major &&
+ altMinor > minor) {
+ minor = altMinor;
+ }
+ }
+ }
+ }
}
}
catch (Exception e)
{
- throw new IllegalArgumentException(
- "Illegally formatted version identifier: \"" + versionString + "\"");
+ e.printStackTrace();
+ throw (IllegalArgumentException)
+ new IllegalArgumentException(
+ "Illegally formatted version identifier: \"" + versionString + "\"")
+ .initCause(e);
}
}
diff --git a/src/classes/com/sun/opengl/impl/macosx/MacOSXGLContext.java b/src/classes/com/sun/opengl/impl/macosx/MacOSXGLContext.java
index e7b06e32e..0a2d2f613 100644
--- a/src/classes/com/sun/opengl/impl/macosx/MacOSXGLContext.java
+++ b/src/classes/com/sun/opengl/impl/macosx/MacOSXGLContext.java
@@ -86,7 +86,11 @@ public abstract class MacOSXGLContext extends GLContextImpl
}
protected boolean create() {
- return create(false, false);
+ // Note that we specify pbuffer support for all contexts by
+ // default; workaround for problem on Mac OS X 10.4.3 where could
+ // not share textures and display lists between pbuffers and
+ // on-screen contexts
+ return create(true, false);
}
/**