From 30b2490eef5069214eb6cc0c1b18ddb62c15123b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 20 Mar 2013 10:58:07 +0100 Subject: TestGearsES2NEWT/TestGearsES2NewtCanvasAWT: Add -noanim option to manually validate Bug 649 --- .../jogl/demos/es2/newt/TestGearsES2NEWT.java | 43 +++++++++++++++------- .../demos/es2/newt/TestGearsES2NewtCanvasAWT.java | 43 +++++++++++++++------- 2 files changed, 58 insertions(+), 28 deletions(-) (limited to 'src/test') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java index 14b1f04b0..5dee22e1d 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java @@ -89,6 +89,7 @@ public class TestGearsES2NEWT extends UITestCase { static boolean forceGL3 = false; static boolean mainRun = false; static boolean exclusiveContext = false; + static boolean useAnimator = true; @BeforeClass public static void initClass() { @@ -138,9 +139,11 @@ public class TestGearsES2NEWT extends UITestCase { }); } - Animator animator = new Animator(); - animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD); - animator.setExclusiveContext(exclusiveContext); + final Animator animator = useAnimator ? new Animator() : null; + if( useAnimator ) { + animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD); + animator.setExclusiveContext(exclusiveContext); + } QuitAdapter quitAdapter = new QuitAdapter(); //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter)); @@ -246,14 +249,18 @@ public class TestGearsES2NEWT extends UITestCase { } }); - animator.add(glWindow); - animator.start(); - Assert.assertTrue(animator.isStarted()); - Assert.assertTrue(animator.isAnimating()); - Assert.assertEquals(exclusiveContext ? animator.getThread() : null, glWindow.getExclusiveContextThread()); + if( useAnimator ) { + animator.add(glWindow); + animator.start(); + Assert.assertTrue(animator.isStarted()); + Assert.assertTrue(animator.isAnimating()); + Assert.assertEquals(exclusiveContext ? animator.getThread() : null, glWindow.getExclusiveContextThread()); + } glWindow.setVisible(true); - animator.setUpdateFPSFrames(60, showFPS ? System.err : null); + if( useAnimator ) { + animator.setUpdateFPSFrames(60, showFPS ? System.err : null); + } System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities()); System.err.println("GL chosen: "+glWindow.getChosenCapabilities()); @@ -265,14 +272,19 @@ public class TestGearsES2NEWT extends UITestCase { System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); } - while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration() pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); } - while(!quitAdapter.shouldQuit() && animator.getTotalFPSDuration()