summaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-02-25 23:10:06 +0100
committerSven Gothel <[email protected]>2014-02-25 23:10:06 +0100
commitd84812b6fb398c73cb3f339ab13d74b7e6822181 (patch)
tree00a915d49855938cfb5d98701d6e63bf4c6e1977 /src/test/com/jogamp
parent64bdefac9191334ace292683a6a7c4274bc3f72b (diff)
Bug 802: Graph TextRenderer Performance Part-2 (fix artifacts, cleanup, incomplete)
- OutlineShape - Add DIRTY_VERTICES bit in triangulation, which in turn solves the rendering artifact issue. - transformOutlines(..) -> protected - Note: Always pick triangles first, then vertices. The former renders vertices dirty. - Region - Make triangles / vertices accessible - Add 'validateIndices()' to add indices for triangles, code moved from the GLRegion* impl. Shall be refined later! - GLRegion - Passing 'RegionRenderer' instead of RenderState .. reducing argument numbers and aligning all related 'render' methods while giving association to the RegionRenderer. - Renderer -> RegionRenderer, dropping 'intermediate' RegionRenderer - Dropping draw() in RegionRenderer, should be issued simply by GLRegion in a unique fashion. - Dropping RegionFactory Too simple code as-is, simply invoke in Region.create(..) - Overall: - Add 'final' qualifier - Remove overloaded methods where rither default args can be used or a followup method call completes the 'intention'.
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java32
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java27
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionRendererListenerBase01.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java11
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java9
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/opengl/UIRegion.java16
16 files changed, 77 insertions, 82 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java
index 9e15746a6..619fe23c5 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java
@@ -45,7 +45,7 @@ import org.junit.runners.MethodSorters;
import com.jogamp.common.os.Platform;
import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.Renderer;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.TextRenderUtil;
import com.jogamp.graph.font.FontFactory;
import com.jogamp.graph.geom.SVertex;
@@ -228,7 +228,7 @@ public class TestTextRendererNEWT01 extends UITestCase {
gl.setSwapInterval(1);
gl.glEnable(GL.GL_DEPTH_TEST);
- final Renderer renderer = getRenderer();
+ final RegionRenderer renderer = getRenderer();
renderer.setAlpha(gl, 1.0f);
renderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java
index 1f4a95511..2a349b2de 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java
@@ -41,8 +41,8 @@ import org.junit.Test;
import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.TextRenderUtil;
import com.jogamp.graph.font.Font;
import com.jogamp.graph.font.FontFactory;
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 704e98999..da1fb5515 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
@@ -34,8 +34,8 @@ import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.fixedfunc.GLMatrixFunc;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.TextRenderUtil;
import com.jogamp.graph.font.Font;
import com.jogamp.graph.font.FontFactory;
@@ -201,4 +201,4 @@ public abstract class TextRendererGLELBase implements GLEventListener {
lastRow = -1;
}
}
-} \ No newline at end of file
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
index 43e5537e9..2673a0e85 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
@@ -31,26 +31,27 @@ package com.jogamp.opengl.test.junit.graph.demos;
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
+
import com.jogamp.graph.curve.OutlineShape;
import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
/** Demonstrate the rendering of multiple outlines into one region/OutlineShape
* These Outlines are not necessary connected or contained.
* The output of this demo shows two identical shapes but the left one
- * has some vertices with off-curve flag set to true, and the right allt he vertices
- * are on the curve. Demos the Res. Independent Nurbs based Curve rendering
+ * has some vertices with off-curve flag set to true, and the right allt he vertices
+ * are on the curve. Demos the Res. Independent Nurbs based Curve rendering
*
*/
public class GPURegionGLListener01 extends GPURegionRendererListenerBase01 {
OutlineShape outlineShape = null;
-
+
public GPURegionGLListener01 (RenderState rs, int renderModes, int fbosize, boolean debug, boolean trace) {
super(rs, renderModes, debug, trace);
setMatrix(-20, 00, 0f, -50, fbosize);
}
-
+
private void createTestOutline(){
float offset = 0;
outlineShape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
@@ -68,7 +69,7 @@ public class GPURegionGLListener01 extends GPURegionRendererListenerBase01 {
outlineShape.addVertex(10.0f,0.0f, true);
outlineShape.addVertex(5.0f,0.0f, false);
outlineShape.closeLastOutline();
-
+
/** Same shape as above but without any off-curve vertices */
offset = 30;
outlineShape.addEmptyOutline();
@@ -86,23 +87,24 @@ public class GPURegionGLListener01 extends GPURegionRendererListenerBase01 {
outlineShape.addVertex(offset+10.0f,-5.0f, true);
outlineShape.addVertex(offset+10.0f,0.0f, true);
outlineShape.closeLastOutline();
-
- region = GLRegion.create(outlineShape, getRenderModes());
+
+ region = GLRegion.create(getRenderModes());
+ region.addOutlineShape(outlineShape, null);
}
public void init(GLAutoDrawable drawable) {
super.init(drawable);
-
+
GL2ES2 gl = drawable.getGL().getGL2ES2();
- final RegionRenderer regionRenderer = (RegionRenderer) getRenderer();
+ final RegionRenderer regionRenderer = getRenderer();
gl.setSwapInterval(1);
gl.glEnable(GL2ES2.GL_DEPTH_TEST);
gl.glEnable(GL2ES2.GL_BLEND);
regionRenderer.setAlpha(gl, 1.0f);
regionRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
-
+
createTestOutline();
}
@@ -112,14 +114,14 @@ public class GPURegionGLListener01 extends GPURegionRendererListenerBase01 {
gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- final RegionRenderer regionRenderer = (RegionRenderer) getRenderer();
-
+ final RegionRenderer regionRenderer = getRenderer();
+
regionRenderer.resetModelview(null);
regionRenderer.translate(null, getXTran(), getYTran(), getZoom());
regionRenderer.rotate(gl, getAngle(), 0, 1, 0);
if( weight != regionRenderer.getWeight()) {
regionRenderer.setWeight(gl, weight);
}
- regionRenderer.draw(gl, region, getTexSize());
- }
+ region.draw(gl, regionRenderer, getTexSize());
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java
index 3565dbc48..222265c37 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java
@@ -37,8 +37,8 @@ import javax.media.opengl.GLAutoDrawable;
import com.jogamp.graph.curve.OutlineShape;
import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
/** Demonstrate the rendering of multiple OutlineShapes
* into one region
@@ -51,7 +51,7 @@ public class GPURegionGLListener02 extends GPURegionRendererListenerBase01 {
super(rs, renderModes, debug, trace);
setMatrix(-20, 00, 0f, -50, fbosize);
}
-
+
private void createTestOutline(){
float offset = 0;
OutlineShape shape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
@@ -70,7 +70,7 @@ public class GPURegionGLListener02 extends GPURegionRendererListenerBase01 {
shape.addVertex(10.0f,0.0f, true);
shape.addVertex(5.0f,0.0f, false);
shape.closeLastOutline();
-
+
/** Same shape as above but without any off-curve vertices */
shape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
outlineShapes.add(shape);
@@ -89,23 +89,24 @@ public class GPURegionGLListener02 extends GPURegionRendererListenerBase01 {
shape.addVertex(offset+10.0f,-5.0f, true);
shape.addVertex(offset+10.0f,0.0f, true);
shape.closeLastOutline();
-
- region = GLRegion.create(outlineShapes, getRenderModes());
+
+ region = GLRegion.create(getRenderModes());
+ region.addOutlineShapes(outlineShapes);
}
public void init(GLAutoDrawable drawable) {
super.init(drawable);
-
+
GL2ES2 gl = drawable.getGL().getGL2ES2();
- final RegionRenderer regionRenderer = (RegionRenderer) getRenderer();
+ final RegionRenderer regionRenderer = getRenderer();
gl.setSwapInterval(1);
gl.glEnable(GL2ES2.GL_DEPTH_TEST);
gl.glEnable(GL2ES2.GL_BLEND);
regionRenderer.setAlpha(gl, 1.0f);
regionRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
-
+
createTestOutline();
}
@@ -115,15 +116,15 @@ public class GPURegionGLListener02 extends GPURegionRendererListenerBase01 {
gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- final RegionRenderer regionRenderer = (RegionRenderer) getRenderer();
-
+ final RegionRenderer regionRenderer = getRenderer();
+
regionRenderer.resetModelview(null);
regionRenderer.translate(null, getXTran(), getYTran(), getZoom());
regionRenderer.rotate(gl, getAngle(), 0, 1, 0);
if( weight != regionRenderer.getWeight()) {
regionRenderer.setWeight(gl, weight);
}
- regionRenderer.draw(gl, region, getTexSize());
-
- }
+ region.draw(gl, regionRenderer, getTexSize());
+
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionRendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionRendererListenerBase01.java
index 8439d1fff..1ec69878a 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionRendererListenerBase01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionRendererListenerBase01.java
@@ -37,7 +37,7 @@ import com.jogamp.graph.curve.opengl.RenderState;
* - 1/2: zoom in/out
* - 3/4: font +/-
* - 6/7: 2nd pass texture size
- * - 0/9: rotate
+ * - 0/9: rotate
* - s: toogle draw 'font set'
* - f: toggle draw fps
* - v: toggle v-sync
@@ -48,5 +48,5 @@ public abstract class GPURegionRendererListenerBase01 extends GPURendererListene
public GPURegionRendererListenerBase01(RenderState rs, int renderModes, boolean debug, boolean trace) {
super(RegionRenderer.create(rs, renderModes), renderModes, debug, trace);
- }
-} \ No newline at end of file
+ }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java
index 4e3d271e1..7041f9f91 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java
@@ -45,7 +45,7 @@ import javax.media.opengl.GLRunnable;
import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.Renderer;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.event.KeyListener;
import com.jogamp.newt.opengl.GLWindow;
@@ -62,7 +62,7 @@ import com.jogamp.opengl.util.GLReadBufferUtil;
* - s: screenshot
*/
public abstract class GPURendererListenerBase01 implements GLEventListener {
- private final Renderer renderer;
+ private final RegionRenderer renderer;
private final int renderModes;
private final boolean debug;
private final boolean trace;
@@ -86,7 +86,7 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
protected volatile float weight = 1.0f;
boolean ignoreInput = false;
- public GPURendererListenerBase01(Renderer renderer, int renderModes, boolean debug, boolean trace) {
+ public GPURendererListenerBase01(RegionRenderer renderer, int renderModes, boolean debug, boolean trace) {
this.renderer = renderer;
this.renderModes = renderModes;
this.debug = debug;
@@ -94,7 +94,7 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
this.screenshot = new GLReadBufferUtil(false, false);
}
- public final Renderer getRenderer() { return renderer; }
+ public final RegionRenderer getRenderer() { return renderer; }
public final int getRenderModes() { return renderModes; }
public final float getZoom() { return zoom; }
public final float getXTran() { return xTran; }
@@ -141,7 +141,7 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
autoDrawable = null;
GL2ES2 gl = drawable.getGL().getGL2ES2();
if(null != region) {
- region.destroy(gl, renderer.getRenderState());
+ region.destroy(gl, renderer);
}
screenshot.dispose(gl);
renderer.destroy(gl);
@@ -163,7 +163,7 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
dumpMatrix();
}
public void editGlobalWeight(float delta) {
- if( !Renderer.isWeightValid(weight+delta) ) {
+ if( !RegionRenderer.isWeightValid(weight+delta) ) {
return;
}
weight += delta;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java
index 4d544019c..05914b5bf 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java
@@ -32,7 +32,7 @@ import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.Renderer;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.geom.SVertex;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.util.glsl.ShaderState;
@@ -57,7 +57,7 @@ public class GPUTextGLListener0A extends GPUTextRendererListenerBase01 {
GL2ES2 gl = drawable.getGL().getGL2ES2();
- final Renderer renderer = getRenderer();
+ final RegionRenderer renderer = getRenderer();
gl.setSwapInterval(1);
gl.glEnable(GL2ES2.GL_DEPTH_TEST);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java
index d90b4f849..3fbe5b816 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java
@@ -35,9 +35,8 @@ import javax.media.opengl.GLAnimatorControl;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLException;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.Renderer;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.TextRenderUtil;
import com.jogamp.graph.font.Font;
import com.jogamp.graph.font.FontFactory;
@@ -154,7 +153,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); // Demo02 needs to have this set here as well .. hmm ?
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- final Renderer renderer = getRenderer();
+ final RegionRenderer renderer = getRenderer();
renderer.reshapeOrtho(null, width, height, 0.1f, 7000.0f);
renderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
final GLAnimatorControl animator = drawable.getAnimator();
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
index c9f27df80..0c4d5fbbf 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
@@ -11,8 +11,8 @@ import javax.media.opengl.GLPipelineFactory;
import javax.media.opengl.GLRunnable;
import com.jogamp.graph.curve.Region;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.font.Font;
import com.jogamp.graph.font.FontFactory;
import com.jogamp.graph.geom.SVertex;
@@ -300,8 +300,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
regionRenderer.scale(gl, 1.5f, 1.5f, 1.0f);
regionRenderer.rotate(gl, angText , 0, 1, 0);
regionRenderer.setColorStatic(gl, 0.0f, 1.0f, 0.0f);
- regionRenderer.draw(gl, jogampRegion.getRegion(gl, regionRenderer, 0), null);
-
+ jogampRegion.getRegion(gl, regionRenderer, 0).draw(gl, regionRenderer, null);
if(null == labelRegions[currentText]) {
if( null == labels[currentText]) {
labels[currentText] = new Label(SVertex.factory(), font, fontSizeFixed, strings[currentText]){
@@ -321,14 +320,14 @@ public class GPUUISceneGLListener0A implements GLEventListener {
regionRenderer.rotate(gl, zoomText, 0, 1, 0);
regionRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
- regionRenderer.draw(gl, labelRegions[currentText].getRegion(gl, regionRenderer, renderModes2), texSize2);
+ labelRegions[currentText].getRegion(gl, regionRenderer, renderModes2).draw(gl, regionRenderer, texSize2);
final GLAnimatorControl animator = drawable.getAnimator();
final boolean _drawFPS = showFPS && null != animator;
if(_drawFPS && fps != animator.getTotalFPS()) {
if(null != fpsRegion) {
- fpsRegion.destroy(gl, rs);
+ fpsRegion.destroy(gl, regionRenderer);
}
fps = animator.getTotalFPS();
final String fpsS = String.valueOf(fps);
@@ -344,7 +343,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
if(showFPS && null != fpsRegion) {
regionRenderer.translate(gl, 0, -60, 0);
regionRenderer.scale(null, zoomText, zoomText, 1);
- regionRenderer.draw(gl, fpsRegion.getRegion(gl, regionRenderer, 0), null);
+ fpsRegion.getRegion(gl, regionRenderer, renderModes2).draw(gl, regionRenderer, null);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
index baaae3521..4ce732ef7 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
@@ -27,14 +27,10 @@
*/
package com.jogamp.opengl.test.junit.graph.demos.ui;
-import java.util.HashMap;
-
import javax.media.opengl.GL2ES2;
-import com.jogamp.graph.curve.OutlineShape;
import com.jogamp.graph.curve.opengl.GLRegion;
import com.jogamp.graph.curve.opengl.RegionRenderer;
-import com.jogamp.graph.curve.opengl.Renderer;
import com.jogamp.graph.curve.opengl.TextRenderUtil;
import com.jogamp.graph.font.Font;
import com.jogamp.graph.geom.Vertex;
@@ -91,14 +87,14 @@ public abstract class Label extends UIShape implements UITextShape {
}
@Override
- protected void clearImpl(GL2ES2 gl, Renderer renderer) {
+ protected void clearImpl(GL2ES2 gl, RegionRenderer renderer) {
if(null != glyphRegion) {
- glyphRegion.destroy(gl, renderer.getRenderState());
+ glyphRegion.destroy(gl, renderer);
}
}
@Override
- protected void createShape(Renderer renderer) {
+ protected void createShape(RegionRenderer renderer) {
clearImpl(null, null);
glyphRegion = TextRenderUtil.createRegion(renderer.getRenderModes(), renderer.getRenderState().getVertexFactory(),
font, text, size);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java
index d291c903a..6a3b9fc73 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java
@@ -30,7 +30,6 @@ package com.jogamp.opengl.test.junit.graph.demos.ui;
import javax.media.opengl.GL2ES2;
import com.jogamp.graph.curve.opengl.RegionRenderer;
-import com.jogamp.graph.curve.opengl.Renderer;
import com.jogamp.graph.font.Font;
import com.jogamp.graph.geom.Vertex;
import com.jogamp.graph.geom.Vertex.Factory;
@@ -79,12 +78,12 @@ public abstract class RIButton extends UIShape {
}
@Override
- protected void clearImpl(GL2ES2 gl, Renderer renderer) {
+ protected void clearImpl(GL2ES2 gl, RegionRenderer renderer) {
label.clear();
}
@Override
- protected void createShape(Renderer renderer) {
+ protected void createShape(RegionRenderer renderer) {
// FIXME: Only possible if all data (color) is
// is incl. in Outline Shape.
// Until then - draw each separately!
@@ -215,7 +214,7 @@ public abstract class RIButton extends UIShape {
if(!selection){
renderer.setColorStatic(gl, bColor[0], bColor[1], bColor[2]);
}
- renderer.draw(gl, buttonRegion.getRegion(gl, renderer, renderModes), texSize);
+ buttonRegion.getRegion(gl, renderer, renderModes).draw(gl, renderer, texSize);
gl.glDisable(GL2ES2.GL_POLYGON_OFFSET_FILL);
float[] lColor = labelColor;
@@ -225,7 +224,7 @@ public abstract class RIButton extends UIShape {
if(!selection){
renderer.setColorStatic(gl, lColor[0], lColor[1], lColor[2]);
}
- renderer.draw(gl, labelRegion.getRegion(gl, renderer, renderModes), texSize);
+ labelRegion.getRegion(gl, renderer, renderModes).draw(gl, renderer, texSize);
}
public void setPressed(boolean b) {
super.setPressed(b);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
index 7f0254ce6..08fd97ec4 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
@@ -12,8 +12,8 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLRunnable;
import com.jogamp.common.nio.Buffers;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.newt.event.MouseEvent;
import com.jogamp.newt.event.MouseListener;
import com.jogamp.newt.opengl.GLWindow;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
index bfb7d8487..fa3817de8 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
@@ -34,8 +34,8 @@ import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.font.Font;
import com.jogamp.graph.font.FontFactory;
import com.jogamp.graph.geom.SVertex;
@@ -109,19 +109,19 @@ public class UIGLListener01 extends UIListenerBase01 {
regionRenderer.setColorStatic(gl, bColor[0], bColor[1], bColor[2]);
regionRenderer.translate(gl, button.getPosition()[0], button.getPosition()[1], button.getPosition()[2]);
- regionRenderer.draw(gl, regionButton.getRegion(gl, regionRenderer, 0), null);
+ regionButton.getRegion(gl, regionRenderer, 0).draw(gl, regionRenderer, null);
regionRenderer.setColorStatic(gl, lColor[0], lColor[1], lColor[2]);
- regionRenderer.draw(gl, regionLabel.getRegion(gl, regionRenderer, 0), null);
+ regionLabel.getRegion(gl, regionRenderer, 0).draw(gl, regionRenderer, null);
}
public void dispose(GLAutoDrawable drawable) {
GL2ES2 gl = drawable.getGL().getGL2ES2();
if(null != regionButton) {
- regionButton.destroy(gl, getRegionRenderer().getRenderState());
+ regionButton.destroy(gl, getRegionRenderer());
regionButton = null;
}
if(null != regionLabel) {
- regionLabel.destroy(gl, getRegionRenderer().getRenderState());
+ regionLabel.destroy(gl, getRegionRenderer());
regionButton = null;
}
super.dispose(drawable);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
index ff494a5ea..acc91ce65 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
@@ -31,7 +31,6 @@ import javax.media.opengl.GL2ES2;
import com.jogamp.graph.curve.OutlineShape;
import com.jogamp.graph.curve.opengl.RegionRenderer;
-import com.jogamp.graph.curve.opengl.Renderer;
import com.jogamp.graph.geom.Vertex;
import com.jogamp.graph.geom.Vertex.Factory;
import com.jogamp.opengl.math.geom.AABBox;
@@ -87,9 +86,9 @@ public abstract class UIShape {
public float[] getScale() { return scale; }
public float[] getPosition() { return position; }
- protected abstract void clearImpl(GL2ES2 gl, Renderer renderer);
+ protected abstract void clearImpl(GL2ES2 gl, RegionRenderer renderer);
- protected abstract void createShape(Renderer renderer);
+ protected abstract void createShape(RegionRenderer renderer);
public boolean updateShape() {
if( isShapeDirty() ) {
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/opengl/UIRegion.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/opengl/UIRegion.java
index 01e1827ab..8cf987bb3 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/opengl/UIRegion.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/opengl/UIRegion.java
@@ -30,8 +30,7 @@ package com.jogamp.opengl.test.junit.graph.demos.ui.opengl;
import javax.media.opengl.GL2ES2;
import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.Renderer;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.opengl.test.junit.graph.demos.ui.UIShape;
import com.jogamp.opengl.test.junit.graph.demos.ui.UITextShape;
@@ -46,13 +45,14 @@ public class UIRegion {
this.uiShape = uis;
}
- public boolean updateRegion(GL2ES2 gl, Renderer renderer, int renderModes) {
+ public boolean updateRegion(GL2ES2 gl, RegionRenderer renderer, int renderModes) {
if( uiShape.updateShape() || isRegionDirty() ) {
- destroy(gl, renderer.getRenderState());
+ destroy(gl, renderer);
if(uiShape instanceof UITextShape) {
region = ((UITextShape)uiShape).getRegion();
} else {
- region = GLRegion.create(uiShape.getShape(), renderModes);
+ region = GLRegion.create(renderModes);
+ region.addOutlineShape(uiShape.getShape(), null);
}
dirty &= ~DIRTY_REGION;
return true;
@@ -60,7 +60,7 @@ public class UIRegion {
return false;
}
- public GLRegion getRegion(GL2ES2 gl, Renderer renderer, int renderModes) {
+ public GLRegion getRegion(GL2ES2 gl, RegionRenderer renderer, int renderModes) {
updateRegion(gl, renderer, renderModes);
return region;
}
@@ -69,9 +69,9 @@ public class UIRegion {
return 0 != ( dirty & DIRTY_REGION ) ;
}
- public void destroy(GL2ES2 gl, RenderState rs) {
+ public void destroy(GL2ES2 gl, RegionRenderer renderer) {
if(null != region) {
- region.destroy(gl, rs);
+ region.destroy(gl, renderer);
region = null;
}
}