diff options
author | Sven Gothel <[email protected]> | 2013-05-06 17:29:35 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-05-06 17:29:35 +0200 |
commit | 502e1d863e636808b7436354c3b639fc2f92bf29 (patch) | |
tree | d40c3e80755a60314f87e9fe17fc0e537f98a573 /src/jogl/classes | |
parent | 6ebf649d1b87944257fe492e0aef842d1b8debc2 (diff) |
Fix GLSL Version Exposure: Type in 'static' GL -> GLSL matching, don't set GLSL version if GLSL is n/a
Diffstat (limited to 'src/jogl/classes')
4 files changed, 15 insertions, 12 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java index 11e76ef6f..6cd02b749 100644 --- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java +++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java @@ -172,9 +172,9 @@ public class JoglVersion extends JogampVersion { sb.append(Platform.getNewline()); sb.append("GL_VERSION ").append(gl.glGetString(GL.GL_VERSION)); sb.append(Platform.getNewline()); - sb.append("GLSL ").append(gl.hasGLSL()).append(", has-compiler: ").append(gl.isFunctionAvailable("glCompileShader")); + sb.append("GLSL ").append(gl.hasGLSL()).append(", has-compiler-func: ").append(gl.isFunctionAvailable("glCompileShader")); if(gl.hasGLSL()) { - sb.append(", version: ").append(gl.glGetString(GL2ES2.GL_SHADING_LANGUAGE_VERSION)); + sb.append(", version: ").append(gl.glGetString(GL2ES2.GL_SHADING_LANGUAGE_VERSION)).append(" / ").append(ctx.getGLSLVersionNumber()); } sb.append(Platform.getNewline()); sb.append("GL_EXTENSIONS ").append(ctx.getGLExtensionCount()); diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index 95342d455..bbe8d602b 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -737,14 +737,14 @@ public abstract class GLContext { if( 0 != ( CTX_PROFILE_ES & ctxOptions ) ) { res[0] = 1; res[1] = 0; // ES 2.0 -> GLSL 1.00 } else if( 1 == glMajorVersion ) { - res[0] = 1; res[0] = 10; // GL 1.x -> GLSL 1.10 + res[0] = 1; res[1] = 10; // GL 1.x -> GLSL 1.10 } else if( 2 == glMajorVersion ) { res[0] = 1; switch ( glMinorVersion ) { case 0: res[1] = 10; break; // GL 2.0 -> GLSL 1.10 default: res[1] = 20; break; // GL 2.1 -> GLSL 1.20 } - } else if( 3 == glMajorVersion && 2 >= glMajorVersion ) { + } else if( 3 == glMajorVersion && 2 >= glMinorVersion ) { res[0] = 1; switch ( glMinorVersion ) { case 0: res[1] = 30; break; // GL 3.0 -> GLSL 1.30 diff --git a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java index 1a862a3b7..7c7ea1508 100644 --- a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java +++ b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java @@ -42,6 +42,8 @@ package jogamp.opengl; import javax.media.opengl.*; +import com.jogamp.common.util.VersionNumber; + import java.util.*; /** @@ -218,8 +220,9 @@ final class ExtensionAvailabilityCache { } if(!context.isGLES()) { - int major[] = new int[] { context.getGLVersionMajor() }; - int minor[] = new int[] { context.getGLVersionMinor() }; + final VersionNumber version = context.getGLVersionNumber(); + int major[] = new int[] { version.getMajor() }; + int minor[] = new int[] { version.getMinor() }; while (GLContext.isValidGLVersion(major[0], minor[0])) { availableExtensionCache.add("GL_VERSION_" + major[0] + "_" + minor[0]); if (DEBUG) { diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index bd2d21cc9..f16834d28 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1047,7 +1047,7 @@ public abstract class GLContextImpl extends GLContext { ctxOptions = ctp; if(useGL) { ctxGLSLVersion = VersionNumber.zeroVersion; - if(major >= 2) { // >= ES2 || GL2.0 + if( hasGLSL() ) { // >= ES2 || GL2.0 final String glslVersion = gl.glGetString(GL2ES2.GL_SHADING_LANGUAGE_VERSION); if( null != glslVersion ) { ctxGLSLVersion = new VersionNumber(glslVersion, "."); @@ -1055,12 +1055,12 @@ public abstract class GLContextImpl extends GLContext { ctxGLSLVersion = VersionNumber.zeroVersion; // failed .. } } + if( ctxGLSLVersion.isZero() ) { + final int[] sver = new int[2]; + getStaticGLSLVersionNumber(major, minor, ctxOptions, sver); + ctxGLSLVersion = new VersionNumber(sver[0], sver[1], 0); + } } - if( ctxGLSLVersion.isZero() ) { - final int[] sver = new int[2]; - getStaticGLSLVersionNumber(major, minor, ctxOptions, sver); - ctxGLSLVersion = new VersionNumber(sver[0], sver[1], 0); - } } } |