From d22ac65d0f841e4c3698ec817d4ebbfdb7ee25a0 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 7 Sep 2012 08:34:32 +0200 Subject: NEWT AWT Driver: Remove flashing (clear background @ update/paint method) ; Proper canvas size and direct events. --- .../jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/test') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java index 62914bd4e..cc20cc27e 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java @@ -33,6 +33,7 @@ import javax.media.opengl.*; import com.jogamp.opengl.util.Animator; +import com.jogamp.opengl.test.junit.util.AWTRobotUtil; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.util.QuitAdapter; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -78,8 +79,25 @@ public class TestGearsNewtAWTWrapper extends UITestCase { glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter)); glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter)); - glWindow.setSize(width, height); + int div = 3; + glWindow.setSize(width/div, height/div); glWindow.setVisible(true); + glWindow.display(); + Assert.assertTrue("Size not reached: Expected "+(width/div)+"x"+(height/div)+", Is "+glWindow.getWidth()+"x"+glWindow.getHeight(), + AWTRobotUtil.waitForSize(glWindow, width/div, height/div)); + + div = 2; + glWindow.setSize(width/div, height/div); + glWindow.display(); + Assert.assertTrue("Size not reached: Expected "+(width/div)+"x"+(height/div)+", Is "+glWindow.getWidth()+"x"+glWindow.getHeight(), + AWTRobotUtil.waitForSize(glWindow, width/div, height/div)); + + div = 1; + glWindow.setSize(width/div, height/div); + glWindow.display(); + Assert.assertTrue("Size not reached: Expected "+(width/div)+"x"+(height/div)+", Is "+glWindow.getWidth()+"x"+glWindow.getHeight(), + AWTRobotUtil.waitForSize(glWindow, width/div, height/div)); + animator.setUpdateFPSFrames(1, null); animator.start(); -- cgit v1.2.3