From 24fe89e6d7cc551aaffb6c95624271eef027b275 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 21 Feb 2013 09:26:19 +0100 Subject: Fix GLVersionNumber (Bug 679): Don't use a subsequent version number if not valid! --- src/jogl/classes/jogamp/opengl/GLVersionNumber.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes') 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; + } } } } -- cgit v1.2.3