From 90bfd948586881b20704f33acbb74514d27faefe Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 25 Apr 2011 13:44:16 +0200 Subject: FPSCounter def to 5*60 frames (each 5s at 60Hz) ; Test: each 1s --- .../junit/jogl/acore/TestSharedContextListAWT.java | 2 +- .../jogl/acore/TestSharedContextListNEWT.java | 2 +- .../junit/jogl/demos/es2/shader/RedSquareShader.fp | 9 ++++++ .../junit/jogl/demos/es2/shader/RedSquareShader.vp | 9 ++++++ .../jogl/demos/es2/shader/RedSquareShader2.fp | 9 ++++++ .../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 | 2 +- .../gl2/gears/newt/TestGearsNewtAWTWrapper.java | 2 +- .../test/junit/jogl/glsl/GLSLMiscHelper.java | 29 +++++++++++-------- .../junit/jogl/glsl/TestGLSLShaderState01NEWT.java | 33 +++++++++++----------- .../junit/jogl/glsl/TestGLSLShaderState02NEWT.java | 18 ++++++------ .../test/junit/jogl/glsl/TestGLSLSimple01NEWT.java | 2 +- .../jogl/glsl/TestShaderCompilationBug459AWT.java | 2 +- .../junit/newt/TestDisplayLifecycle01NEWT.java | 2 +- .../junit/newt/TestDisplayLifecycle02NEWT.java | 2 +- .../test/junit/newt/TestGLWindows00NEWT.java | 2 +- .../junit/newt/TestGLWindows02NEWTAnimated.java | 10 +++---- .../test/junit/newt/TestListenerCom01AWT.java | 2 +- .../test/junit/newt/TestRemoteGLWindows01NEWT.java | 2 +- .../junit/newt/parenting/TestParenting01NEWT.java | 12 ++++---- .../junit/newt/parenting/TestParenting01aAWT.java | 12 ++++---- .../newt/parenting/TestParenting01cSwingAWT.java | 4 +-- .../junit/newt/parenting/TestParenting03AWT.java | 2 +- .../junit/newt/parenting/TestParenting03bAWT.java | 4 +-- 26 files changed, 105 insertions(+), 74 deletions(-) (limited to 'src/test/com/jogamp') 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 10c4bce42..0793d113e 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(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err); + animator.setUpdateFPSFrames(1, System.err); animator.start(); while(animator.isAnimating() && animator.getTotalFPSDuration()sp.program()); + + sp.add(gl, rsVp, System.err); + sp.add(gl, rsFp, System.err); - Assert.assertTrue(0>sp.program()); - sp.init(gl); Assert.assertTrue(0<=sp.program()); Assert.assertTrue(!sp.inUse()); Assert.assertTrue(!sp.linked()); @@ -105,12 +104,10 @@ public class TestGLSLShaderState01NEWT extends UITestCase { Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); Assert.assertEquals(vertices0_loc, vertices0.getLocation()); - Assert.assertEquals(vertices0_loc, st.glGetAttribLocation(gl, vertices0.getName())); - Assert.assertEquals(vertices0_loc, gl.glGetAttribLocation(st.shaderProgram().program(), vertices0.getName())); + GLSLMiscHelper.validateGLArrayDataServerState(gl, st, vertices0); Assert.assertEquals(colors0_loc, colors0.getLocation()); - Assert.assertEquals(colors0_loc, st.glGetAttribLocation(gl, colors0.getName())); - Assert.assertEquals(colors0_loc, gl.glGetAttribLocation(st.shaderProgram().program(), colors0.getName())); + GLSLMiscHelper.validateGLArrayDataServerState(gl, st, colors0); Assert.assertEquals(null, ShaderState.getShaderState(gl)); st.glUseProgram(gl, true); @@ -131,11 +128,13 @@ public class TestGLSLShaderState01NEWT extends UITestCase { GLArrayDataServer vertices1 = GLSLMiscHelper.createRSVertices1(gl, st); System.err.println("vertices1: " + vertices1); vertices1.enableBuffer(gl, false); + GLSLMiscHelper.validateGLArrayDataServerState(gl, st, vertices1); // Allocate Color Array1 GLArrayDataServer colors1 = GLSLMiscHelper.createRSColors1(gl, st); System.err.println("colors1: " + colors1); colors1.enableBuffer(gl, false); + GLSLMiscHelper.validateGLArrayDataServerState(gl, st, colors1); // misc GL setup gl.glClearColor(0, 0, 0, 1); @@ -153,13 +152,13 @@ public class TestGLSLShaderState01NEWT extends UITestCase { Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); // display #1 vertices0 / colors0 (post-disable) - GLSLMiscHelper.displayVCArrays(window, gl, true, vertices0, colors0, true, 1, durationPerTest); + GLSLMiscHelper.displayVCArrays(window, gl, st, true, vertices0, colors0, true, 1, durationPerTest); // display #2 #1 vertices1 / colors1 (post-disable) - GLSLMiscHelper.displayVCArrays(window, gl, true, vertices1, colors1, true, 2, durationPerTest); + GLSLMiscHelper.displayVCArrays(window, gl, st, true, vertices1, colors1, true, 2, durationPerTest); // display #3 vertices0 / colors0 (post-disable) - GLSLMiscHelper.displayVCArrays(window, gl, true, vertices0, colors0, true, 3, durationPerTest); + GLSLMiscHelper.displayVCArrays(window, gl, st, true, vertices0, colors0, true, 3, durationPerTest); // cleanup vertices1.destroy(gl); @@ -238,7 +237,7 @@ public class TestGLSLShaderState01NEWT extends UITestCase { int frames; // validation .. - GLSLMiscHelper.displayVCArrays(window, gl, toggleEnable, vertices0, colors0, toggleEnable, 1, 0); + GLSLMiscHelper.displayVCArrays(window, gl, st, toggleEnable, vertices0, colors0, toggleEnable, 1, 0); // warmup .. for(frames=0; frames