From 9c64f265f4e3aaef85b7f017493e3695f46e00b3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 30 Aug 2011 03:42:27 +0200 Subject: minor: update script / vsync changes in test w/ 2 windows --- .../junit/newt/TestGLWindows02NEWTAnimated.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java index 8b7952639..bfc3f43a7 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java @@ -43,7 +43,7 @@ import java.io.IOException; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.util.MiscUtils; -import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears; +import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; public class TestGLWindows02NEWTAnimated extends UITestCase { static GLProfile glp; @@ -58,7 +58,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase { glp = GLProfile.getDefault(); } - static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) { + static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated, boolean vsync) { Assert.assertNotNull(caps); caps.setOnscreen(onscreen); // System.out.println("Requested: "+caps); @@ -78,7 +78,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase { Assert.assertNotNull(glWindow); glWindow.setUndecorated(onscreen && undecorated); - GLEventListener demo = new Gears(); + GLEventListener demo = new GearsES2(vsync ? 1 : 0); setDemoFields(demo, glWindow); glWindow.addGLEventListener(demo); glWindow.addWindowListener(new TraceWindowAdapter()); @@ -117,7 +117,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase { public void testWindowDecor01Simple() throws InterruptedException { GLCapabilities caps = new GLCapabilities(glp); Assert.assertNotNull(caps); - GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */); + GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */); Animator animator = new Animator(window); animator.setUpdateFPSFrames(1, null); Assert.assertTrue(animator.start()); @@ -135,7 +135,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase { public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException { GLCapabilities caps = new GLCapabilities(glp); Assert.assertNotNull(caps); - GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */); + GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */); Animator animator = new Animator(window); animator.setUpdateFPSFrames(1, null); Assert.assertTrue(animator.start()); @@ -160,11 +160,11 @@ public class TestGLWindows02NEWTAnimated extends UITestCase { Screen screen = NewtFactory.createScreen(display, 0); // screen 0 Assert.assertNotNull(screen); - GLWindow window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */); + GLWindow window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */, false /* vsync */); Assert.assertNotNull(window1); window1.setPosition(0, 0); - GLWindow window2 = createWindow(screen, caps, width-10, height-10, true /* onscreen */, false /* undecorated */); + GLWindow window2 = createWindow(screen, caps, width-10, height-10, true /* onscreen */, false /* undecorated */, true /* vsync */); Assert.assertNotNull(window2); window2.setPosition(screen.getWidth()-width, 0); @@ -196,8 +196,8 @@ public class TestGLWindows02NEWTAnimated extends UITestCase { Assert.assertEquals(true, animator.isStarted()); Assert.assertEquals(true, animator.isAnimating()); Assert.assertEquals(false, animator.isPaused()); - - while(animator.isAnimating() && animator.getTotalFPSDuration()<2*durationPerTest) { + // animator.resetFPSCounter(); + while(animator.isAnimating() && animator.getTotalFPSDuration()