diff options
author | Sven Gothel <[email protected]> | 2013-02-21 09:26:19 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-02-21 09:26:19 +0100 |
commit | 24fe89e6d7cc551aaffb6c95624271eef027b275 (patch) | |
tree | 6357b6ad0c19696afd819f6850bcb8d725ed716b /src/jogl/classes/jogamp | |
parent | 43df6ed31d5144fb8fcdab51eae62fc123364a38 (diff) |
Fix GLVersionNumber (Bug 679): Don't use a subsequent version number if not valid!
Diffstat (limited to 'src/jogl/classes/jogamp')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLVersionNumber.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java index 1004f04c6..83815f7a4 100644 --- a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java +++ b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java @@ -29,6 +29,9 @@ package jogamp.opengl; import java.util.StringTokenizer; + +import javax.media.opengl.GLContext; + import com.jogamp.common.util.VersionNumber; /** @@ -90,9 +93,11 @@ class GLVersionNumber extends VersionNumber { // Avoid possibly confusing situations by putting some // constraints on the upgrades we do to the major and // minor versions - if ((altMajor == val[0] && altMinor > val[1]) || altMajor == val[0] + 1) { - val[0] = altMajor; - val[1] = altMinor; + if ( (altMajor == val[0] && altMinor > val[1]) || altMajor == val[0] + 1 ) { + if( GLContext.isValidGLVersion(altMajor, altMinor) ) { + val[0] = altMajor; + val[1] = altMinor; + } } } } |