aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-09-24 05:54:41 +0200
committerSven Gothel <[email protected]>2014-09-24 05:54:41 +0200
commitca357af70d46a6c12ff8810565874ecabb564d87 (patch)
treedb623bafb61e63fc8acbe7d03437dc04e7b26175
parent66ecb6c386d5c3d87d8be2600a0c7dd7d71a4329 (diff)
Fix future compatibility issues (analog to b22x commit 546f9b1a03c46b63f8bb18c1b8e2c80a8b66cf7c)
- GLFBODrawable: - Remove FBOMODE_DEFAULT - GLRendererQuirks: - Remove COUNT - Add getCount() method for future compatibility. - Animator - Hide local fields (private or package private)
-rw-r--r--src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java10
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/Animator.java8
-rw-r--r--src/jogl/classes/javax/media/opengl/GLFBODrawable.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java8
5 files changed, 22 insertions, 30 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
index f81d2f2d0..e8039edf1 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
@@ -341,8 +341,8 @@ public class GLRendererQuirks {
*/
public static final int BuggyColorRenderbuffer = 18;
- /** Number of quirks known. */
- public static final int COUNT = 19;
+ /** Return the number of known quirks. */
+ public static final int getCount() { return 19; }
private static final String[] _names = new String[] { "NoDoubleBufferedPBuffer", "NoDoubleBufferedBitmap", "NoSetSwapInterval",
"NoOffscreenBitmap", "NoSetSwapIntervalPostRetarget", "GLSLBuggyDiscard",
@@ -509,7 +509,7 @@ public class GLRendererQuirks {
}
sb.append("[");
boolean first=true;
- for(int i=0; i<COUNT; i++) {
+ for(int i=0; i<getCount(); i++) {
final int testmask = 1 << i;
if( 0 != ( _bitmask & testmask ) ) {
if(!first) { sb.append(", "); }
@@ -531,8 +531,8 @@ public class GLRendererQuirks {
* @throws IllegalArgumentException if quirk is out of range
*/
public static void validateQuirk(final int quirk) throws IllegalArgumentException {
- if( !( 0 <= quirk && quirk < COUNT ) ) {
- throw new IllegalArgumentException("Quirks must be in range [0.."+COUNT+"[, but quirk: "+quirk);
+ if( !( 0 <= quirk && quirk < getCount() ) ) {
+ throw new IllegalArgumentException("Quirks must be in range [0.."+getCount()+"[, but quirk: "+quirk);
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
index 03c566d7d..b38a42ee3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
@@ -58,12 +58,12 @@ import javax.media.opengl.GLException;
* </p>
*/
public class Animator extends AnimatorBase {
- protected ThreadGroup threadGroup;
+ private ThreadGroup threadGroup;
private Runnable runnable;
private boolean runAsFastAsPossible;
- protected boolean isAnimating;
- protected volatile boolean pauseIssued;
- protected volatile boolean stopIssued;
+ boolean isAnimating;
+ volatile boolean pauseIssued;
+ volatile boolean stopIssued;
/**
* Creates a new, empty Animator.
diff --git a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
index 07cb723a0..524c77e9d 100644
--- a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
@@ -78,12 +78,9 @@ import com.jogamp.opengl.GLRendererQuirks;
public interface GLFBODrawable extends GLDrawable {
// public enum DoubleBufferMode { NONE, TEXTURE, FBO }; // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
- /** FBO Mode Bit: Use a {@link TextureAttachment} for the {@link #getColorbuffer(int) render colorbuffer} ({@link #FBOMODE_DEFAULT default}), see {@link #setFBOMode(int)}. */
+ /** FBO Mode Bit: Use a {@link TextureAttachment} for the {@link #getColorbuffer(int) render colorbuffer}, see {@link #setFBOMode(int)}. */
public static final int FBOMODE_USE_TEXTURE = 1 << 0;
- /** FBO Default Mode Bit: {@link #FBOMODE_USE_TEXTURE}. */
- public static final int FBOMODE_DEFAULT = FBOMODE_USE_TEXTURE;
-
/**
* @return <code>true</code> if initialized, i.e. a {@link GLContext} is bound and made current once, otherwise <code>false</code>.
*/
@@ -92,7 +89,7 @@ public interface GLFBODrawable extends GLDrawable {
/**
* Set the FBO mode bits used for FBO creation.
* <p>
- * See {@link #FBOMODE_DEFAULT} values.
+ * Default value is: {@link #FBOMODE_USE_TEXTURE}.
* </p>
* <p>
* If {@link GLRendererQuirks#BuggyColorRenderbuffer} is set,
@@ -201,8 +198,9 @@ public interface GLFBODrawable extends GLDrawable {
* </p>
* <p>
* Depending on the {@link #setFBOMode(int) fbo mode} the resulting {@link Colorbuffer}
- * is either a {@link TextureAttachment} ({@link #FBOMODE_DEFAULT default}) or a {@link ColorAttachment},
- * see {@link Colorbuffer#isTextureAttachment()}.
+ * is either a {@link TextureAttachment} if {@link #FBOMODE_USE_TEXTURE} is set,
+ * otherwise a {@link ColorAttachment}.
+ * See {@link Colorbuffer#isTextureAttachment()}.
* </p>
* @param bufferName {@link GL#GL_FRONT} and {@link GL#GL_BACK} are valid buffer names
* @return the named {@link Colorbuffer}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java
index a46c5a750..327fecd25 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java
@@ -76,7 +76,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
final GLProfile glp = GLProfile.getGL2ES2();
final GLCapabilities caps = new GLCapabilities(glp);
caps.setDoubleBuffered(false);
- testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0));
+ testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_TEXTURE, new GearsES2(0));
}
@Test
public void test01b_GL2ES2_Demo1_SingleBuffer_NoTex() throws InterruptedException {
@@ -99,7 +99,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
final GLProfile glp = GLProfile.getGL2ES2();
final GLCapabilities caps = new GLCapabilities(glp);
caps.setDoubleBuffered(true); // default
- testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0));
+ testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_TEXTURE, new GearsES2(0));
}
@Test
@@ -108,7 +108,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
final GLCapabilities caps = new GLCapabilities(glp);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
- testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new MultisampleDemoES2(true));
+ testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_TEXTURE, new MultisampleDemoES2(true));
}
@Test
public void test03b_GL2ES2_Demo2MSAA4_NoTex() throws InterruptedException {
@@ -136,7 +136,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
final GLCapabilities caps = new GLCapabilities(glp);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
- testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, demo);
+ testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_TEXTURE, demo);
}
@Test
@@ -144,7 +144,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
if( GLProfile.isAvailable(GLProfile.GLES2) ) {
final GLProfile glp = GLProfile.get(GLProfile.GLES2);
final GLCapabilities caps = new GLCapabilities(glp);
- testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0));
+ testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_TEXTURE, new GearsES2(0));
} else {
System.err.println("EGL ES2 n/a");
}
@@ -157,7 +157,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
final GLCapabilities caps = new GLCapabilities(glp);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
- testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0));
+ testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_TEXTURE, new GearsES2(0));
} else {
System.err.println("EGL ES2 n/a");
}
@@ -168,7 +168,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
if( GLProfile.isAvailable(GLProfile.GL3) ) {
final GLProfile glp = GLProfile.get(GLProfile.GL3);
final GLCapabilities caps = new GLCapabilities(glp);
- testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0));
+ testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_TEXTURE, new GearsES2(0));
} else {
System.err.println("GL3 n/a");
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java
index b1eef9ebd..0c2a7510b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java
@@ -55,16 +55,10 @@ public class TestVersionSemanticsNOUI extends JunitTracer {
static final JogampVersion curVersion = JoglVersion.getInstance();
static final VersionNumberString curVersionNumber = new VersionNumberString(curVersion.getImplementationVersion());
- static final Set<String> excludesDefault, excludeV221toV222;
+ static final Set<String> excludesDefault;
static {
excludesDefault = new HashSet<String>();
excludesDefault.add("^\\Qjogamp/\\E.*$");
-
- excludeV221toV222 = new HashSet<String>();
- excludeV221toV222.add("^\\Qjogamp/\\E.*$");
- excludeV221toV222.add("^\\Qcom/jogamp/opengl/GLRendererQuirks\\E$"); // COUNT increased by one
- excludeV221toV222.add("^\\Qcom/jogamp/opengl/util/Animator\\E$"); // pauseIssued -> volatile
- excludeV221toV222.add("^\\Qjavax/media/opengl/GLFBODrawable\\E$"); // FBOMODE_DEFAULT (removed USE_DEPTH)
}