summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-10-25 00:33:58 +0200
committerSven Gothel <[email protected]>2014-10-25 00:33:58 +0200
commit729f4ef2d7e1bbb2748d71998046818aeabcd558 (patch)
tree33f0bf308d284d8acf25688536663390bc4a1b92 /src/jogl/classes
parentaaaa48f4401555612ece10fce5dfe6163587f420 (diff)
GLContext.Version* VersionNumber Constants: Clarify names, avoiding mis-interpretation alike Version130 -> [ 1.3.0 | 1.30.0 ] ?
Diffstat (limited to 'src/jogl/classes')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java2
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java54
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java10
4 files changed, 34 insertions, 34 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
index 3b8706a24..acbb943a7 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
@@ -1049,7 +1049,7 @@ public class ShaderCode {
public static final boolean requiresGL3DefaultPrecision(final GL2ES2 gl) {
if( gl.isGL3() ) {
final VersionNumber glslVersion = gl.getContext().getGLSLVersionNumber();
- return glslVersion.compareTo(GLContext.Version130) >= 0 && glslVersion.compareTo(GLContext.Version150) < 0 ;
+ return glslVersion.compareTo(GLContext.Version1_30) >= 0 && glslVersion.compareTo(GLContext.Version1_50) < 0 ;
} else {
return false;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
index 06f7d9268..499917732 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
@@ -221,7 +221,7 @@ public class ShaderUtil {
/** Returns true if GeometryShader is supported, i.e. whether GLContext is &ge; 3.2 or ARB_geometry_shader4 extension is available. */
public static boolean isGeometryShaderSupported(final GL _gl) {
final GLContext ctx = _gl.getContext();
- return ctx.getGLVersionNumber().compareTo(GLContext.Version320) >= 0 ||
+ return ctx.getGLVersionNumber().compareTo(GLContext.Version3_2) >= 0 ||
ctx.isExtensionAvailable(GLExtensions.ARB_geometry_shader4);
}
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index f27f4f91b..503280e74 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -123,17 +123,17 @@ public abstract class GLContext {
public static final int CONTEXT_CURRENT_NEW = 2;
/** Version 1.00, i.e. GLSL 1.00 for ES 2.0. */
- public static final VersionNumber Version100 = new VersionNumber(1, 0, 0);
+ public static final VersionNumber Version1_0 = new VersionNumber(1, 0, 0);
/** Version 1.10, i.e. GLSL 1.10 for GL 2.0. */
- public static final VersionNumber Version110 = new VersionNumber(1, 10, 0);
+ public static final VersionNumber Version1_10 = new VersionNumber(1, 10, 0);
/** Version 1.20, i.e. GLSL 1.20 for GL 2.1. */
- public static final VersionNumber Version120 = new VersionNumber(1, 20, 0);
+ public static final VersionNumber Version1_20 = new VersionNumber(1, 20, 0);
/** Version 1.30, i.e. GLSL 1.30 for GL 3.0. */
- public static final VersionNumber Version130 = new VersionNumber(1, 30, 0);
+ public static final VersionNumber Version1_30 = new VersionNumber(1, 30, 0);
/** Version 1.40, i.e. GLSL 1.40 for GL 3.1. */
- public static final VersionNumber Version140 = new VersionNumber(1, 40, 0);
+ public static final VersionNumber Version1_40 = new VersionNumber(1, 40, 0);
/** Version 1.50, i.e. GLSL 1.50 for GL 3.2. */
- public static final VersionNumber Version150 = new VersionNumber(1, 50, 0);
+ public static final VersionNumber Version1_50 = new VersionNumber(1, 50, 0);
/** Version 1.1, i.e. GL 1.1 */
public static final VersionNumber Version1_1 = new VersionNumber(1, 1, 0);
@@ -148,18 +148,18 @@ public abstract class GLContext {
public static final VersionNumber Version1_5 = new VersionNumber(1, 5, 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);
+ public static final VersionNumber Version3_0 = new VersionNumber(3, 0, 0);
/** Version 3.1. As an OpenGL version, it qualifies for {@link #isGL3core()}, {@link #isGL3bc()} and {@link #isGL3()} */
- public static final VersionNumber Version310 = new VersionNumber(3, 1, 0);
+ public static final VersionNumber Version3_1 = new VersionNumber(3, 1, 0);
/** Version 3.2. As an OpenGL version, it qualifies for geometry shader */
- public static final VersionNumber Version320 = new VersionNumber(3, 2, 0);
+ public static final VersionNumber Version3_2 = new VersionNumber(3, 2, 0);
/** Version 4.3. As an OpenGL version, it qualifies for <code>GL_ARB_ES3_compatibility</code> */
- public static final VersionNumber Version430 = new VersionNumber(4, 3, 0);
+ public static final VersionNumber Version4_3 = new VersionNumber(4, 3, 0);
- protected static final VersionNumber Version800 = new VersionNumber(8, 0, 0);
+ protected static final VersionNumber Version8_0 = new VersionNumber(8, 0, 0);
private static final String S_EMPTY = "";
@@ -856,11 +856,11 @@ public abstract class GLContext {
final int minor = ctxGLSLVersion.getMinor();
final String profileOpt;
if( isGLES() ) {
- profileOpt = ctxGLSLVersion.compareTo(Version300) >= 0 ? " es" : S_EMPTY;
+ profileOpt = ctxGLSLVersion.compareTo(Version3_0) >= 0 ? " es" : S_EMPTY;
} else if( isGLCoreProfile() ) {
- profileOpt = ctxGLSLVersion.compareTo(Version150) >= 0 ? " core" : S_EMPTY;
+ profileOpt = ctxGLSLVersion.compareTo(Version1_50) >= 0 ? " core" : S_EMPTY;
} else if( isGLCompatibilityProfile() ) {
- profileOpt = ctxGLSLVersion.compareTo(Version150) >= 0 ? " compatibility" : S_EMPTY;
+ profileOpt = ctxGLSLVersion.compareTo(Version1_50) >= 0 ? " compatibility" : S_EMPTY;
} else {
throw new InternalError("Neither ES, Core nor Compat: "+this); // see validateProfileBits(..)
}
@@ -870,22 +870,22 @@ public abstract class GLContext {
protected static final VersionNumber getStaticGLSLVersionNumber(final int glMajorVersion, final int glMinorVersion, final int ctxOptions) {
if( 0 != ( CTX_PROFILE_ES & ctxOptions ) ) {
if( 3 == glMajorVersion ) {
- return Version300; // ES 3.0 -> GLSL 3.00
+ return Version3_0; // ES 3.0 -> GLSL 3.00
} else if( 2 == glMajorVersion ) {
- return Version100; // ES 2.0 -> GLSL 1.00
+ return Version1_0; // ES 2.0 -> GLSL 1.00
}
} else if( 1 == glMajorVersion ) {
- return Version110; // GL 1.x -> GLSL 1.10
+ return Version1_10; // GL 1.x -> GLSL 1.10
} else if( 2 == glMajorVersion ) {
switch ( glMinorVersion ) {
- case 0: return Version110; // GL 2.0 -> GLSL 1.10
- default: return Version120; // GL 2.1 -> GLSL 1.20
+ case 0: return Version1_10; // GL 2.0 -> GLSL 1.10
+ default: return Version1_20; // GL 2.1 -> GLSL 1.20
}
} else if( 3 == glMajorVersion && 2 >= glMinorVersion ) {
switch ( glMinorVersion ) {
- case 0: return Version130; // GL 3.0 -> GLSL 1.30
- case 1: return Version140; // GL 3.1 -> GLSL 1.40
- default: return Version150; // GL 3.2 -> GLSL 1.50
+ case 0: return Version1_30; // GL 3.0 -> GLSL 1.30
+ case 1: return Version1_40; // GL 3.1 -> GLSL 1.40
+ default: return Version1_50; // GL 3.2 -> GLSL 1.50
}
}
// The new default: GL >= 3.3, ES >= 3.0
@@ -1044,7 +1044,7 @@ public abstract class GLContext {
*/
public final boolean isGL3bc() {
return 0 != (ctxOptions & CTX_PROFILE_COMPAT) &&
- ctxVersion.compareTo(Version310) >= 0 ;
+ ctxVersion.compareTo(Version3_1) >= 0 ;
}
/**
@@ -1053,7 +1053,7 @@ public abstract class GLContext {
*/
public final boolean isGL3() {
return 0 != (ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_CORE)) &&
- ctxVersion.compareTo(Version310) >= 0 ;
+ ctxVersion.compareTo(Version3_1) >= 0 ;
}
/**
@@ -1061,7 +1061,7 @@ public abstract class GLContext {
*/
public final boolean isGL3core() {
return 0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
- ctxVersion.compareTo(Version310) >= 0;
+ ctxVersion.compareTo(Version3_1) >= 0;
}
/**
@@ -1070,7 +1070,7 @@ public abstract class GLContext {
public final boolean isGLcore() {
return ( 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 2 ) ||
( 0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
- ctxVersion.compareTo(Version310) >= 0
+ ctxVersion.compareTo(Version3_1) >= 0
) ;
}
@@ -1118,7 +1118,7 @@ public abstract class GLContext {
return // ES 3.x not included, see above. ( 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 3 ) ||
( 0 != ( ctxOptions & CTX_IS_ARB_CREATED ) &&
0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
- ctxVersion.compareTo(Version310) >= 0
+ ctxVersion.compareTo(Version3_1) >= 0
) ;
}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 45a4f2426..bf860e92c 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -728,7 +728,7 @@ public abstract class GLContextImpl extends GLContext {
if( 0 == ( ctxOptions & GLContext.CTX_PROFILE_ES) ) { // not ES profile
final int reqMajor;
final int reqProfile;
- if( ctxVersion.compareTo(Version300) <= 0 ) {
+ if( ctxVersion.compareTo(Version3_0) <= 0 ) {
reqMajor = 2;
} else {
reqMajor = ctxVersion.getMajor();
@@ -1396,8 +1396,8 @@ public abstract class GLContextImpl extends GLContext {
*
* @param force force the setting, even if is already being set.
* This might be useful if you change the OpenGL implementation.
- * @param major OpenGL major version
- * @param minor OpenGL minor version
+ * @param major requested OpenGL major version
+ * @param minor requested OpenGL minor version
* @param ctxProfileBits OpenGL context profile and option bits, see {@link javax.media.opengl.GLContext#CTX_OPTION_ANY}
* @param strictMatch if <code>true</code> the ctx must
* <ul>
@@ -1501,7 +1501,7 @@ public abstract class GLContextImpl extends GLContext {
// - _and_ a valid int version was fetched,
// otherwise cont. w/ version-string method -> 3.0 > Version || Version > MAX!
//
- if ( ( major >= 3 || hasGLVersionByString.compareTo(Version300) >= 0 ) &&
+ if ( ( major >= 3 || hasGLVersionByString.compareTo(Version3_0) >= 0 ) &&
GLContext.isValidGLVersion(ctxProfileBits, hasGLVersionByInt.getMajor(), hasGLVersionByInt.getMinor()) ) {
// Strict Match (GLVersionMapping):
// Relaxed match for versions ( !isES && major < 3 ) requests, last resort!
@@ -1892,7 +1892,7 @@ public abstract class GLContextImpl extends GLContext {
//
final int quirk = GLRendererQuirks.DontCloseX11Display;
if( glRenderer.contains(MesaSP) ) {
- if ( glRenderer.contains("X11") && vendorVersion.compareTo(Version800) < 0 ) {
+ if ( glRenderer.contains("X11") && vendorVersion.compareTo(Version8_0) < 0 ) {
if(DEBUG) {
System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: X11 Renderer=" + glRenderer + ", Version=[vendor " + vendorVersion + ", GL " + glVersion+"]");
}