From ca357af70d46a6c12ff8810565874ecabb564d87 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 24 Sep 2014 05:54:41 +0200 Subject: 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) --- src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java | 10 +++++----- src/jogl/classes/com/jogamp/opengl/util/Animator.java | 8 ++++---- src/jogl/classes/javax/media/opengl/GLFBODrawable.java | 12 +++++------- .../junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java | 14 +++++++------- .../test/junit/jogl/acore/TestVersionSemanticsNOUI.java | 8 +------- 5 files changed, 22 insertions(+), 30 deletions(-) (limited to 'src') 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 */ 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 true if initialized, i.e. a {@link GLContext} is bound and made current once, otherwise false. */ @@ -92,7 +89,7 @@ public interface GLFBODrawable extends GLDrawable { /** * Set the FBO mode bits used for FBO creation. *

- * See {@link #FBOMODE_DEFAULT} values. + * Default value is: {@link #FBOMODE_USE_TEXTURE}. *

*

* If {@link GLRendererQuirks#BuggyColorRenderbuffer} is set, @@ -201,8 +198,9 @@ public interface GLFBODrawable extends GLDrawable { *

*

* 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()}. *

* @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 excludesDefault, excludeV221toV222; + static final Set excludesDefault; static { excludesDefault = new HashSet(); excludesDefault.add("^\\Qjogamp/\\E.*$"); - - excludeV221toV222 = new HashSet(); - 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) } -- cgit v1.2.3