From f47230cb4649df13260ac56c5dae6c01dad7c1e7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 26 Apr 2011 07:47:19 +0200 Subject: Newt Window: Remove 'invalidate()' method, only 'destroy()' is required (and makes sense) - WindowImpl/GLWindow: Cleanup destroy code .. - Tests: sync / remove FPS stderr print --- .../test/junit/jogl/acore/TestGLProfile01NEWT.java | 2 +- .../junit/jogl/acore/TestSharedContextListAWT.java | 2 +- .../jogl/acore/TestSharedContextListNEWT.java | 2 +- .../test/junit/jogl/demos/es2/RedSquare0.java | 6 +-- .../jogl/demos/es2/shader/RedSquareShader.java | 4 +- .../junit/jogl/demos/gl2/gears/TestGearsAWT.java | 2 +- .../jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java | 2 +- .../gl2/gears/TestGearsGLJPanelAWTBug450.java | 2 +- .../jogl/demos/gl2/gears/newt/TestGearsNEWT.java | 4 +- .../gl2/gears/newt/TestGearsNewtAWTWrapper.java | 4 +- .../junit/jogl/drawable/TestDrawable01NEWT.java | 2 +- .../jogl/glsl/TestShaderCompilationBug459AWT.java | 2 +- ...TestSwingAWTRobotUsageBeforeJOGLInitBug411.java | 13 +++---- .../junit/newt/TestDisplayLifecycle01NEWT.java | 5 +-- .../junit/newt/TestDisplayLifecycle02NEWT.java | 20 +++------- .../test/junit/newt/TestEventSourceNotAWTBug.java | 2 +- .../test/junit/newt/TestFocus01SwingAWTRobot.java | 2 +- .../test/junit/newt/TestFocus02SwingAWTRobot.java | 2 +- .../test/junit/newt/TestGLWindows00NEWT.java | 5 +-- .../test/junit/newt/TestGLWindows01NEWT.java | 3 +- .../junit/newt/TestGLWindows02NEWTAnimated.java | 28 ++++++++------ .../test/junit/newt/TestListenerCom01AWT.java | 4 +- .../test/junit/newt/TestRemoteGLWindows01NEWT.java | 5 +-- .../test/junit/newt/TestScreenMode00NEWT.java | 2 +- .../newt/TestWindowClosingProtocol02NEWT.java | 2 - .../newt/TestWindowClosingProtocol03NewtAWT.java | 2 - .../junit/newt/parenting/TestParenting01NEWT.java | 44 +++++----------------- .../junit/newt/parenting/TestParenting01aAWT.java | 34 ++++++++--------- .../junit/newt/parenting/TestParenting01bAWT.java | 2 +- .../junit/newt/parenting/TestParenting01cAWT.java | 14 +++---- .../newt/parenting/TestParenting01cSwingAWT.java | 24 ++++++------ .../junit/newt/parenting/TestParenting02AWT.java | 2 +- .../junit/newt/parenting/TestParenting03AWT.java | 4 +- .../junit/newt/parenting/TestParenting03bAWT.java | 8 ++-- 34 files changed, 110 insertions(+), 151 deletions(-) (limited to 'src/test/com') 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..898337602 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 @@ -155,7 +155,7 @@ public class TestGLProfile01NEWT extends UITestCase { glWindow.display(); Thread.sleep(100); - glWindow.invalidate(); + glWindow.destroy(); } public static void main(String args[]) throws IOException { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java index 0793d113e..9f515c1b5 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java @@ -120,7 +120,7 @@ public class TestSharedContextListAWT extends UITestCase { GLCanvas glc2 = runTestGL(f2, animator, width, 0, true); GLCanvas glc3 = runTestGL(f3, animator, 0, height, false); - animator.setUpdateFPSFrames(1, System.err); + animator.setUpdateFPSFrames(1, null); animator.start(); while(animator.isAnimating() && animator.getTotalFPSDuration() glwindow2 ; can be recreated .. glWindow1.destroy(); - Assert.assertEquals(true, glWindow1.isValid()); Assert.assertEquals(false, glWindow1.isNativeValid()); - Assert.assertEquals(true, glWindow2.isValid()); Assert.assertEquals(false, glWindow2.isNativeValid()); Assert.assertEquals(0,display.getReferenceCount()); Assert.assertEquals(false,display.isNativeValid()); @@ -278,13 +272,8 @@ public class TestParenting01NEWT extends UITestCase { Assert.assertEquals(false,screen.isNativeValid()); Assert.assertEquals(0,Display.getActiveDisplayNumber()); - glWindow1.invalidate(); - Assert.assertEquals(false, glWindow1.isValid()); - Assert.assertEquals(false, glWindow2.isValid()); - // test double destroy/invalidate .. - glWindow2.invalidate(); - Assert.assertEquals(false, glWindow2.isValid()); + glWindow2.destroy(); Assert.assertEquals(0,display.getReferenceCount()); Assert.assertEquals(false,display.isNativeValid()); @@ -374,10 +363,10 @@ public class TestParenting01NEWT extends UITestCase { Assert.assertTrue(0 < glWindow1.getTotalFPSFrames()); Animator animator1 = new Animator(glWindow1); - animator1.setUpdateFPSFrames(1, System.err); + animator1.setUpdateFPSFrames(1, null); animator1.start(); Animator animator2 = new Animator(glWindow2); - animator2.setUpdateFPSFrames(1, System.err); + animator2.setUpdateFPSFrames(1, null); animator2.start(); int state = 0; @@ -460,10 +449,8 @@ public class TestParenting01NEWT extends UITestCase { // destroy glWindow2 glWindow2.destroy(); - Assert.assertEquals(true, glWindow1.isValid()); Assert.assertEquals(true, glWindow1.isNativeValid()); Assert.assertEquals(true, glWindow1.isVisible()); - Assert.assertEquals(true, glWindow2.isValid()); Assert.assertEquals(false, glWindow2.isNativeValid()); Assert.assertEquals(false, glWindow2.isVisible()); @@ -478,10 +465,8 @@ public class TestParenting01NEWT extends UITestCase { // destroy glWindow1 glWindow1.destroy(); - Assert.assertEquals(true, glWindow1.isValid()); Assert.assertEquals(false, glWindow1.isNativeValid()); Assert.assertEquals(false, glWindow1.isVisible()); - Assert.assertEquals(true, glWindow2.isValid()); Assert.assertEquals(false, glWindow2.isNativeValid()); Assert.assertEquals(false, glWindow2.isVisible()); @@ -493,13 +478,6 @@ public class TestParenting01NEWT extends UITestCase { Assert.assertEquals(false,screen1.isNativeValid()); Assert.assertEquals(0,Display.getActiveDisplayNumber()); - - glWindow1.invalidate(); - Assert.assertEquals(false, glWindow1.isValid()); - Assert.assertEquals(true, glWindow2.isValid()); - - glWindow2.invalidate(); - Assert.assertEquals(false, glWindow2.isValid()); } @Test @@ -573,10 +551,10 @@ public class TestParenting01NEWT extends UITestCase { Assert.assertEquals(1,Display.getActiveDisplayNumber()); Animator animator1 = new Animator(glWindow1); - animator1.setUpdateFPSFrames(1, System.err); + animator1.setUpdateFPSFrames(1, null); animator1.start(); Animator animator2 = new Animator(glWindow2); - animator2.setUpdateFPSFrames(1, System.err); + animator2.setUpdateFPSFrames(1, null); animator2.start(); int state = 0; @@ -638,10 +616,8 @@ public class TestParenting01NEWT extends UITestCase { Assert.assertEquals(1,Display.getActiveDisplayNumber()); glWindow1.destroy(); // should destroy both windows, actually, since glWindow2 is a child - Assert.assertEquals(true, glWindow1.isValid()); Assert.assertEquals(false, glWindow1.isNativeValid()); Assert.assertEquals(false, glWindow1.isVisible()); - Assert.assertEquals(true, glWindow2.isValid()); Assert.assertEquals(false, glWindow2.isNativeValid()); Assert.assertEquals(false, glWindow2.isVisible()); @@ -665,9 +641,9 @@ public class TestParenting01NEWT extends UITestCase { Assert.assertEquals(false, glWindow1.isNativeValid()); Assert.assertEquals(false, glWindow2.isNativeValid()); - glWindow1.invalidate(); // parent -> child - Assert.assertEquals(false, glWindow1.isValid()); - Assert.assertEquals(false, glWindow2.isValid()); + glWindow1.destroy(); // parent -> child + Assert.assertEquals(false, glWindow1.isNativeValid()); + Assert.assertEquals(false, glWindow2.isNativeValid()); Assert.assertEquals(0,Display.getActiveDisplayNumber()); } diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java index b737cf709..50461bba0 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java @@ -123,7 +123,7 @@ public class TestParenting01aAWT extends UITestCase { Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent()); Animator animator1 = new Animator(glWindow1); - animator1.setUpdateFPSFrames(1, System.err); + animator1.setUpdateFPSFrames(1, null); animator1.start(); while(animator1.isAnimating() && animator1.getTotalFPSDuration()