aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/FunctionAvailabilityCache.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-11-13 06:42:16 +0000
committerKenneth Russel <[email protected]>2005-11-13 06:42:16 +0000
commitc03d5c63fb2529488fea2657fdd359db18ceae0b (patch)
tree5aa283d3af12978280c13be17a81a93d803732eb /src/classes/com/sun/opengl/impl/FunctionAvailabilityCache.java
parentf40b89f1a105d8f1f17651ed0e731145e49a924c (diff)
Added workaround for problem on Mac OS X 10.4.3 where could not share
textures and display lists between a pbuffer and an on-screen OpenGL context; now specify pbuffer support for all created contexts. Tested on 10.3.9 and 10.4.3. See 4129317 on Apple's Bug Reporter for first report of this bug. Added workaround for older OpenGL version strings being reported with older graphics cards on OS X; now attempt to parse vendor-specific version string. Added workaround for ProceduralTexturePhysics demo on OS X where pbuffer's rendering results were not being flushed each frame; this demo is now working properly on 10.4.3 with recent hardware. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@443 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/FunctionAvailabilityCache.java')
-rw-r--r--src/classes/com/sun/opengl/impl/FunctionAvailabilityCache.java29
1 files changed, 27 insertions, 2 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);
}
}