From 97401c4b832aa6f65bfbad47c54d18e4b720dbce Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Thu, 21 Feb 2013 09:35:05 +0100
Subject: Relax GLContextImpl.setGLFunctionAvailability(..)'s Version Matching
 if testing major < 3 versions. (Bug 679)

On OSX, we 'only' support the ctx ARB creation and hence have no !ARM fallback.

If querying a version [2.0 .. 3.0] for GL2, it is acceptable if a valid OpenGL version is lower, e.g. 1.4.
---
 src/jogl/classes/jogamp/opengl/GLContextImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl')

diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index e279c0423..98b9ede36 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -1301,7 +1301,7 @@ public abstract class GLContextImpl extends GLContext {
         // Only validate if a valid int version was fetched, otherwise cont. w/ version-string method -> 3.0 > Version || Version > MAX!
         if ( GLContext.isValidGLVersion(glIntMajor[0], glIntMinor[0]) ) {
             if( glIntMajor[0]<major || ( glIntMajor[0]==major && glIntMinor[0]<minor ) || 0 == major ) {        
-                if( strictMatch && 0 < major ) {
+                if( strictMatch && 2 < major ) { // relaxed match for versions major < 3 requests, last resort!
                     if(DEBUG) {
                         System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL version mismatch (Int): "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+glIntMajor[0]+"."+glIntMinor[0]);
                     }
@@ -1326,7 +1326,7 @@ public abstract class GLContextImpl extends GLContext {
         // Only validate if a valid string version was fetched -> MIN > Version || Version > MAX!
         if( null != strGLVersionNumber ) {
             if( strGLVersionNumber.compareTo(setGLVersionNumber) < 0 || 0 == major ) {
-                if( strictMatch && 0 < major ) {
+                if( strictMatch && 2 < major ) { // relaxed match for versions major < 3 requests, last resort!
                     if(DEBUG) {
                         System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL version mismatch (String): "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+strGLVersionNumber);
                     }
-- 
cgit v1.2.3