aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/GLContext.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-10-25 04:44:06 +0200
committerSven Gothel <[email protected]>2013-10-25 04:44:06 +0200
commit5ee57df0fab57124afb31bc65fd87e9184cf8f16 (patch)
tree88f304fefaa4e9dfc325dd56c0719dd6f3189085 /src/jogl/classes/javax/media/opengl/GLContext.java
parented47ed58374fe57e2d1db9b2d0af6e29595016dd (diff)
Fix Bug 872: ES3 and ES3-GLSL Version not properly Handled
GLContext: - Proper API doc for Version* fields - getStaticGLSLVersionNumber(): ES3 -> Version300 - hasGLSL(): Add ES3 ShaderCode: - addDefaultShaderPrecision(): - ES2 default precision: Don't 'tune up' default precision for fragment shader, use 'mediump' - Add ES3 default precision (equal to ES2 default precision) - requiresDefaultPrecision(): Shall returns 'true' for ES3 as well!
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLContext.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 55050f25c..e83d60b66 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -118,20 +118,20 @@ public abstract class GLContext {
/** Indicates that a newly-created context was made current during the last call to {@link #makeCurrent makeCurrent}, value {@value}. */
public static final int CONTEXT_CURRENT_NEW = 2;
- /* Version 1.00, i.e. GLSL 1.00 for ES 2.0. */
+ /** Version 1.00, i.e. GLSL 1.00 for ES 2.0. */
public static final VersionNumber Version100 = new VersionNumber(1, 0, 0);
- /* Version 1.10, i.e. GLSL 1.10 for GL 2.0. */
+ /** Version 1.10, i.e. GLSL 1.10 for GL 2.0. */
public static final VersionNumber Version110 = new VersionNumber(1, 10, 0);
- /* Version 1.20, i.e. GLSL 1.20 for GL 2.1. */
+ /** Version 1.20, i.e. GLSL 1.20 for GL 2.1. */
public static final VersionNumber Version120 = new VersionNumber(1, 20, 0);
- /* Version 1.30, i.e. GLSL 1.30 for GL 3.0. */
+ /** Version 1.30, i.e. GLSL 1.30 for GL 3.0. */
public static final VersionNumber Version130 = new VersionNumber(1, 30, 0);
- /* Version 1.40, i.e. GLSL 1.40 for GL 3.1. */
+ /** Version 1.40, i.e. GLSL 1.40 for GL 3.1. */
public static final VersionNumber Version140 = new VersionNumber(1, 40, 0);
- /* Version 1.50, i.e. GLSL 1.50 for GL 3.2. */
+ /** Version 1.50, i.e. GLSL 1.50 for GL 3.2. */
public static final VersionNumber Version150 = new VersionNumber(1, 50, 0);
- /** Version 3.0. As an OpenGL version, it qualifies for desktop {@link #isGL2()} only, or ES 3.0. */
+ /** Version 3.0. As an OpenGL version, it qualifies for desktop {@link #isGL2()} only, or ES 3.0. Or GLSL 3.00 for ES 3.0. */
public static final VersionNumber Version300 = new VersionNumber(3, 0, 0);
/** Version 3.1. As an OpenGL version, it qualifies for {@link #isGL3core()}, {@link #isGL3bc()} and {@link #isGL3()} */
@@ -749,7 +749,8 @@ public abstract class GLContext {
* <p>
* Examples w/ <code>major.minor</code>:
* <pre>
- * 1.00 (ES 2.0), 1.10 (GL 2.0), 1.20 (GL 2.1), 1.50 (GL 3.2),
+ * 1.00 (ES 2.0), 3.00 (ES 3.0)
+ * 1.10 (GL 2.0), 1.20 (GL 2.1), 1.50 (GL 3.2),
* 3.30 (GL 3.3), 4.00 (GL 4.0), 4.10 (GL 4.1), 4.20 (GL 4.2)
* </pre >
* </p>
@@ -800,7 +801,9 @@ public abstract class GLContext {
protected static final VersionNumber getStaticGLSLVersionNumber(int glMajorVersion, int glMinorVersion, int ctxOptions) {
if( 0 != ( CTX_PROFILE_ES & ctxOptions ) ) {
- if( 3 > glMajorVersion ) {
+ if( 3 == glMajorVersion ) {
+ return Version300; // ES 3.0 -> GLSL 3.00
+ } else if( 2 == glMajorVersion ) {
return Version100; // ES 2.0 -> GLSL 1.00
}
} else if( 1 == glMajorVersion ) {
@@ -850,11 +853,12 @@ public abstract class GLContext {
}
/**
- * @return true if context supports GLSL, i.e. is either {@link #isGLES2()}, {@link #isGL3()} or {@link #isGL2()} <i>and</i> major-version > 1.
+ * @return true if context supports GLSL, i.e. is either {@link #isGLES3()}, {@link #isGLES2()}, {@link #isGL3()} or {@link #isGL2()} <i>and</i> major-version > 1.
* @see GLProfile#hasGLSL()
*/
public final boolean hasGLSL() {
- return isGLES2() ||
+ return isGLES3() ||
+ isGLES2() ||
isGL3() ||
isGL2() && ctxVersion.getMajor()>1 ;
}