From 5dfa035f5319a888592df1954f82131e0ed37ba6 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 5 Jul 2013 05:06:35 +0200 Subject: Workaround NVidia driver 325.8 returning 4.3-compat for any compat request, i.e. allowing 4.3 and 4.4 for GL version validation. 4.4 b/c it may come up soon. --- src/jogl/classes/javax/media/opengl/GLContext.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index 684d0de65..daede5ac0 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -1157,7 +1157,14 @@ public abstract class GLContext { /* 1.*/ { 0, 1, 2, 3, 4, 5 }, /* 2.*/ { 0, 1 }, /* 3.*/ { 0, 1, 2, 3 }, - /* 4.*/ { 0, 1, 2 } }; + /* 4.*/ { 0, 1, 2 } }; // FIXME add 4.3 ! + + private static final int GL_VERSIONS_VALID[][] = { + /* 0.*/ { -1 }, + /* 1.*/ { 0, 1, 2, 3, 4, 5 }, + /* 2.*/ { 0, 1 }, + /* 3.*/ { 0, 1, 2, 3 }, + /* 4.*/ { 0, 1, 2, 3, 4 } }; // 4.4 coming up soon ? public static final int getMaxMajor() { return GL_VERSIONS.length-1; @@ -1169,8 +1176,8 @@ public abstract class GLContext { } public static final boolean isValidGLVersion(int major, int minor) { - if(1>major || major>=GL_VERSIONS.length) return false; - if(0>minor || minor>=GL_VERSIONS[major].length) return false; + if(1>major || major>=GL_VERSIONS_VALID.length) return false; + if(0>minor || minor>=GL_VERSIONS_VALID[major].length) return false; return true; } -- cgit v1.2.3