aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-02-23 15:40:49 +0100
committerSven Gothel <[email protected]>2014-02-23 15:40:49 +0100
commitf69df875d0b9f969a816d143ed589b25e50cd9e7 (patch)
tree0c42a7430d1cf02a60c19a8b6046303dd41da414 /src/test/com
parent3352601e0860584509adf2b76f993d03893ded4b (diff)
Bug 801: Graph TextRenderer Cleanup Part-1b (clean)
Concludes commit f51933f0ebe9ae030c26c066e59a728ce08b8559 w/ final fixes on merge commit 3352601e0860584509adf2b76f993d03893ded4b.
Diffstat (limited to 'src/test/com')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java153
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java3
2 files changed, 109 insertions, 47 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java b/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
index e9609ca9c..9942f3f1d 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
@@ -59,8 +59,8 @@ public class TestRegionRendererNEWT01 extends UITestCase {
public static void main(String args[]) throws IOException {
String tstname = TestRegionRendererNEWT01.class.getName();
org.junit.runner.JUnitCore.main(tstname);
- }
-
+ }
+
static void destroyWindow(GLWindow window) {
if(null!=window) {
window.destroy();
@@ -81,45 +81,74 @@ public class TestRegionRendererNEWT01 extends UITestCase {
}
@Test
- public void testRegionRendererR2T01() throws InterruptedException {
+ public void test00RegionRendererNONE01() throws InterruptedException {
+ GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+ GLCapabilities caps = new GLCapabilities(glp);
+ // caps.setOnscreen(false);
+ caps.setAlphaBits(4);
+
+ GLWindow window = createWindow("shape-vbaa0-msaa0", caps, 800, 400);
+ RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
+
+ GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false);
+ demo01Listener.attachInputListenerTo(window);
+ window.addGLEventListener(demo01Listener);
+
+ RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01");
+ window.addGLEventListener(listener);
+
+ listener.setTech(-20, 00, 0f, -300, 400);
+ window.display();
+
+ listener.setTech(-20, 00, 0f, -150, 800);
+ window.display();
+
+ listener.setTech(-20, 00, 0f, -50, 1000);
+ window.display();
+
+ destroyWindow(window);
+ }
+
+ @Test
+ public void test01RegionRendererNONE02() throws InterruptedException {
if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME
- // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
+ // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
+ // FIXME: Also the GLSL code for VARIABLE_CURVE is not fit for mobile yet!
System.err.println("disabled on non desktop (x86) arch for now ..");
return;
}
- GLProfile glp = GLProfile.getGL2ES2();
-
+ GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
GLCapabilities caps = new GLCapabilities(glp);
- //caps.setOnscreen(false);
- caps.setAlphaBits(4);
+ caps.setAlphaBits(4);
- GLWindow window = createWindow("shape-vbaa1-msaa0", caps, 800,400);
+ GLWindow window = createWindow("shape-vbaa0-msaa0", caps, 800, 400);
RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
- GPURegionGLListener02 demo02Listener = new GPURegionGLListener02 (rs, Region.VBAA_RENDERING_BIT, 1140, false, false);
- demo02Listener.attachInputListenerTo(window);
- window.addGLEventListener(demo02Listener);
-
- RegionGLListener listener = new RegionGLListener(demo02Listener, window.getTitle(), "GPURegionNewtDemo02");
+
+ GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARIABLE_CURVE_WEIGHT_BIT, 0, false, false);
+ demo01Listener.attachInputListenerTo(window);
+ window.addGLEventListener(demo01Listener);
+
+ RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02");
window.addGLEventListener(listener);
-
+
listener.setTech(-20, 00, 0f, -300, 400);
window.display();
-
+
listener.setTech(-20, 00, 0f, -150, 800);
window.display();
-
+
listener.setTech(-20, 00, 0f, -50, 1000);
window.display();
- destroyWindow(window);
+ destroyWindow(window);
}
-
+
@Test
- public void testRegionRendererMSAA01() throws InterruptedException {
+ public void test10RegionRendererMSAA01() throws InterruptedException {
GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
GLCapabilities caps = new GLCapabilities(glp);
// caps.setOnscreen(false);
- caps.setAlphaBits(4);
+ caps.setAlphaBits(4);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
@@ -127,26 +156,26 @@ public class TestRegionRendererNEWT01 extends UITestCase {
RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false);
- demo01Listener.attachInputListenerTo(window);
+ demo01Listener.attachInputListenerTo(window);
window.addGLEventListener(demo01Listener);
-
+
RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01");
window.addGLEventListener(listener);
-
+
listener.setTech(-20, 00, 0f, -300, 400);
window.display();
-
+
listener.setTech(-20, 00, 0f, -150, 800);
window.display();
-
+
listener.setTech(-20, 00, 0f, -50, 1000);
window.display();
-
- destroyWindow(window);
+
+ destroyWindow(window);
}
-
+
@Test
- public void testRegionRendererMSAA02() throws InterruptedException {
+ public void test11RegionRendererMSAA02() throws InterruptedException {
if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME
// FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
// FIXME: Also the GLSL code for VARIABLE_CURVE is not fit for mobile yet!
@@ -155,7 +184,7 @@ public class TestRegionRendererNEWT01 extends UITestCase {
}
GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
GLCapabilities caps = new GLCapabilities(glp);
- caps.setAlphaBits(4);
+ caps.setAlphaBits(4);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
@@ -163,43 +192,77 @@ public class TestRegionRendererNEWT01 extends UITestCase {
RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARIABLE_CURVE_WEIGHT_BIT, 0, false, false);
- demo01Listener.attachInputListenerTo(window);
+ demo01Listener.attachInputListenerTo(window);
window.addGLEventListener(demo01Listener);
-
+
RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02");
window.addGLEventListener(listener);
-
+
listener.setTech(-20, 00, 0f, -300, 400);
window.display();
-
+
listener.setTech(-20, 00, 0f, -150, 800);
window.display();
-
+
listener.setTech(-20, 00, 0f, -50, 1000);
window.display();
-
- destroyWindow(window);
+
+ destroyWindow(window);
}
-
+
+ @Test
+ public void test20RegionRendererR2T01() throws InterruptedException {
+ if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME
+ // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
+ System.err.println("disabled on non desktop (x86) arch for now ..");
+ return;
+ }
+ GLProfile glp = GLProfile.getGL2ES2();
+
+ GLCapabilities caps = new GLCapabilities(glp);
+ //caps.setOnscreen(false);
+ caps.setAlphaBits(4);
+
+ GLWindow window = createWindow("shape-vbaa1-msaa0", caps, 800,400);
+ RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
+ GPURegionGLListener02 demo02Listener = new GPURegionGLListener02 (rs, Region.VBAA_RENDERING_BIT, 1140, false, false);
+ demo02Listener.attachInputListenerTo(window);
+ window.addGLEventListener(demo02Listener);
+
+ RegionGLListener listener = new RegionGLListener(demo02Listener, window.getTitle(), "GPURegionNewtDemo02");
+ window.addGLEventListener(listener);
+
+ listener.setTech(-20, 00, 0f, -300, 400);
+ window.display();
+
+ listener.setTech(-20, 00, 0f, -150, 800);
+ window.display();
+
+ listener.setTech(-20, 00, 0f, -50, 1000);
+ window.display();
+
+ destroyWindow(window);
+ }
+
private class RegionGLListener implements GLEventListener {
String winTitle;
String name;
GPURegionRendererListenerBase01 impl;
-
+
public RegionGLListener(GPURegionRendererListenerBase01 impl, String title, String name) {
this.impl = impl;
this.winTitle = title;
this.name = name;
}
-
+
public void setTech(float xt, float yt, float angle, int zoom, int fboSize){
- impl.setMatrix(xt, yt, angle, zoom, fboSize);
+ impl.setMatrix(xt, yt, angle, zoom, fboSize);
}
public void init(GLAutoDrawable drawable) {
impl.init(drawable);
}
-
+
public void display(GLAutoDrawable drawable) {
impl.display(drawable);
@@ -214,12 +277,12 @@ public class TestRegionRendererNEWT01 extends UITestCase {
public void dispose(GLAutoDrawable drawable) {
impl.dispose(drawable);
-
+
}
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
impl.reshape(drawable, x, y, width, height);
-
+
}
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
index 1282d5d97..38afed7fe 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
@@ -44,7 +44,6 @@ import com.jogamp.opengl.util.PMVMatrix;
import com.jogamp.opengl.util.glsl.ShaderState;
public abstract class TextRendererGLELBase implements GLEventListener {
- protected final float[] textPosition = new float[] {0,0,0};
protected final int[] texSize = new int[] { 0 };
protected final float[] staticRGBAColor = new float[] { 1f, 1f, 1f, 1f };
@@ -182,7 +181,7 @@ public abstract class TextRendererGLELBase implements GLEventListener {
pmvMatrix.glScalef(pixelScale, pixelScale, 1f);
}
renderer.updateMatrix(gl);
- renderer.drawString3D(gl, font, text, textPosition, fontSize, texSize);
+ renderer.drawString3D(gl, font, text, fontSize, texSize);
st.useProgram(gl, false);
gl.glDisable(GL2ES2.GL_BLEND);