diff options
author | Sven Gothel <[email protected]> | 2011-07-07 03:49:06 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-07-07 03:49:06 +0200 |
commit | daa18e59e03c3e3141e9c4a456eea2fa14fed18c (patch) | |
tree | 8ff509c77ea5b2c7cc4cbf53ae10e380d5b00be9 /src/test/com | |
parent | bcf5d6ac871a29398b441df617923d3dd2cf35c1 (diff) |
GLProfile: Initialization fix and clarifications ( GLExceptions on n/a profiles )
- Backport of master: 29cc5fa0375026c09bcbfed16627fe9eb6c97846
- GLProfile.initSingleton(boolean) (implicit or explicit) won't
throw any exception anymore. Followup 'GLProfile GLProfile.get(..)'
calls will throw a GLException, if n/a.
Availability maybe queried via GLProfile.isAvailable(..).
- GLCapabilties, GLCanvas, GLJPanel: Clarify case where GLException maybe thrown,
i.e. no default GLProfile available on default device.
- Remove redundant GLProfile.is<ProfileName>Available(..)
Diffstat (limited to 'src/test/com')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java | 50 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java | 6 |
2 files changed, 24 insertions, 32 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java index d4f24bb19..fd191bab0 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java @@ -68,22 +68,22 @@ public class TestGLProfile01NEWT extends UITestCase { GLProfile glp = GLProfile.getDefault(); System.out.println("GLProfile.getDefault(): "+glp); if(glp.getName().equals(GLProfile.GL4bc)) { - Assert.assertTrue(GLProfile.isGL4bcAvailable()); - Assert.assertTrue(GLProfile.isGL3bcAvailable()); - Assert.assertTrue(GLProfile.isGL2Available()); - Assert.assertTrue(GLProfile.isGL2ES1Available()); - Assert.assertTrue(GLProfile.isGL2ES2Available()); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4bc)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL3bc)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES1)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES2)); } else if(glp.getName().equals(GLProfile.GL3bc)) { - Assert.assertTrue(GLProfile.isGL3bcAvailable()); - Assert.assertTrue(GLProfile.isGL2Available()); - Assert.assertTrue(GLProfile.isGL2ES1Available()); - Assert.assertTrue(GLProfile.isGL2ES2Available()); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL3bc)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES1)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES2)); } else if(glp.getName().equals(GLProfile.GL2)) { - Assert.assertTrue(GLProfile.isGL2Available()); - Assert.assertTrue(GLProfile.isGL2ES1Available()); - Assert.assertTrue(GLProfile.isGL2ES2Available()); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES1)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES2)); } else if(glp.getName().equals(GLProfile.GL2ES1)) { - Assert.assertTrue(GLProfile.isGL2ES1Available()); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES1)); } dumpVersion(glp); } @@ -100,29 +100,21 @@ public class TestGLProfile01NEWT extends UITestCase { GLProfile glp = GLProfile.getMaxProgrammable(); System.out.println("GLProfile.getMaxProgrammable(): "+glp); if(glp.getName().equals(GLProfile.GL4)) { - Assert.assertTrue(GLProfile.isGL4Available()); - Assert.assertTrue(GLProfile.isGL3Available()); - Assert.assertTrue(GLProfile.isGL2Available()); - Assert.assertTrue(GLProfile.isGL2ES1Available()); - Assert.assertTrue(GLProfile.isGL2ES2Available()); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL3)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES2)); } else if(glp.getName().equals(GLProfile.GL3)) { - Assert.assertTrue(GLProfile.isGL3Available()); - Assert.assertTrue(GLProfile.isGL2Available()); - Assert.assertTrue(GLProfile.isGL2ES1Available()); - Assert.assertTrue(GLProfile.isGL2ES2Available()); - } else if(glp.getName().equals(GLProfile.GL2)) { - Assert.assertTrue(GLProfile.isGL2Available()); - Assert.assertTrue(GLProfile.isGL2ES1Available()); - Assert.assertTrue(GLProfile.isGL2ES2Available()); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL3)); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES2)); } else if(glp.getName().equals(GLProfile.GL2ES2)) { - Assert.assertTrue(GLProfile.isGL2ES2Available()); + Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES2)); } dumpVersion(glp); } @Test public void test04GLProfileGL2ES1() throws InterruptedException { - if(!GLProfile.isGL2ES1Available()) { + if(!GLProfile.isAvailable(GLProfile.GL2ES1)) { System.out.println("GLProfile GL2ES1 n/a"); return; } @@ -133,7 +125,7 @@ public class TestGLProfile01NEWT extends UITestCase { @Test public void test05GLProfileGL2ES2() throws InterruptedException { - if(!GLProfile.isGL2ES2Available()) { + if(!GLProfile.isAvailable(GLProfile.GL2ES2)) { System.out.println("GLProfile GL2ES2 n/a"); return; } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java index be4873ff6..a6d04cf24 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java @@ -83,7 +83,7 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase { private GLWindow prepareTest() { - if(!GLProfile.isGL3Available()) { + if(!GLProfile.isAvailable(GLProfile.GL3)) { System.err.println("GL3 not available"); System.err.println(GLProfile.glAvailabilityToString()); return null; @@ -136,7 +136,7 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase { @Test(timeout=60000) public void testGlTransformFeedbackVaryings_WhenVarNameOK() { - if(!GLProfile.isGL3Available()) { + if(!GLProfile.isAvailable(GLProfile.GL3)) { return; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -178,7 +178,7 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase { @Test(timeout=60000) public void testGlTransformFeedbackVaryings_WhenVarNameWrong() { - if(!GLProfile.isGL3Available()) { + if(!GLProfile.isAvailable(GLProfile.GL3)) { return; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); |