From 44469633e779d005e1e4a811fddd2c4a40143362 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 13 Jun 2013 12:16:42 +0200 Subject: TestRedSquareES2NEWT: Cleanup --- .../jogl/demos/es2/newt/TestRedSquareES2NEWT.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java index a84eacb0d..0e5842b23 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java @@ -35,6 +35,7 @@ import com.jogamp.opengl.test.junit.util.AWTRobotUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.util.QuitAdapter; +import com.jogamp.opengl.test.junit.util.UITestCase.SnapshotGLEventListener; import com.jogamp.opengl.util.Animator; @@ -70,15 +71,19 @@ public class TestRedSquareES2NEWT extends UITestCase { protected void runTestGL(GLCapabilities caps) throws InterruptedException { System.err.println("requested: vsync "+vsync+", "+caps); - GLWindow glWindow = GLWindow.create(caps); + final GLWindow glWindow = GLWindow.create(caps); Assert.assertNotNull(glWindow); - glWindow.setTitle("Gears NEWT Test"); + glWindow.setTitle(getSimpleTestName(".")); glWindow.setSize(width, height); final RedSquareES2 demo = new RedSquareES2(vsync ? 1 : -1); demo.setDoRotation(doRotate); glWindow.addGLEventListener(demo); + final SnapshotGLEventListener snap = new SnapshotGLEventListener(); + snap.setPostSNDetail(demo.getClass().getSimpleName()); + glWindow.addGLEventListener(snap); + Animator animator = new Animator(glWindow); QuitAdapter quitAdapter = new QuitAdapter(); @@ -87,18 +92,17 @@ public class TestRedSquareES2NEWT extends UITestCase { glWindow.addKeyListener(quitAdapter); glWindow.addWindowListener(quitAdapter); - final GLWindow f_glWindow = glWindow; glWindow.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { if(e.getKeyChar()=='f') { new Thread() { public void run() { - f_glWindow.setFullscreen(!f_glWindow.isFullscreen()); + glWindow.setFullscreen(!glWindow.isFullscreen()); } }.start(); } else if(e.getKeyChar()=='d') { new Thread() { public void run() { - f_glWindow.setUndecorated(!f_glWindow.isUndecorated()); + glWindow.setUndecorated(!glWindow.isUndecorated()); } }.start(); } } @@ -113,6 +117,7 @@ public class TestRedSquareES2NEWT extends UITestCase { System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); animator.setUpdateFPSFrames(60, System.err); + snap.setMakeSnapshot(); while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()