diff options
author | Sven Gothel <[email protected]> | 2013-10-29 18:03:40 -0700 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-10-29 18:03:40 -0700 |
commit | 36bfd2b06d174b0bc2b5f39aa074dc1d128bc363 (patch) | |
tree | 286c9cda507f4325e2fae21608cf15ebd78c6e1f | |
parent | c53440b808ecf8ea066479c004cac4cdbb1e989d (diff) | |
parent | 85be81387d33224036b3fe2b02d74aab2926e028 (diff) |
Merge pull request #72 from masterzen/tickets/875
Fix #875 - ES version should be strictly validated
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLContextImpl.java | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index a15352c52..eae40631d 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1390,6 +1390,8 @@ public abstract class GLContextImpl extends GLContext { } } + boolean isES = ( CTX_PROFILE_ES & ctxProfileBits ) != 0; + // // Validate GL version either by GL-Integer or GL-String // @@ -1428,10 +1430,13 @@ public abstract class GLContextImpl extends GLContext { } return false; } - // Use returned GL version! - major = glIntMajor[0]; - minor = glIntMinor[0]; - versionValidated = true; + // impose strict matching for ES + if ((isES && major == glIntMajor[0]) || !isES) { + // Use returned GL version! + major = glIntMajor[0]; + minor = glIntMinor[0]; + versionValidated = true; + } } else { versionGL3IntFailed = true; } @@ -1459,10 +1464,13 @@ public abstract class GLContextImpl extends GLContext { } return false; } - // Use returned GL version! - major = hasGLVersionNumber.getMajor(); - minor = hasGLVersionNumber.getMinor(); - versionValidated = true; + // impose strict matching for ES + if ((isES && major == hasGLVersionNumber.getMajor()) || !isES) { + // Use returned GL version! + major = hasGLVersionNumber.getMajor(); + minor = hasGLVersionNumber.getMinor(); + versionValidated = true; + } } } if( strictMatch && !versionValidated ) { @@ -1555,7 +1563,7 @@ public abstract class GLContextImpl extends GLContext { } } - if( 0 != ( CTX_PROFILE_ES & ctxProfileBits ) ) { + if( isES ) { if( major >= 3 ) { ctxProfileBits |= CTX_IMPL_ES3_COMPAT | CTX_IMPL_ES2_COMPAT ; ctxProfileBits |= CTX_IMPL_FBO; |