aboutsummaryrefslogtreecommitdiffstats
path: root/src/demos
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-04-20 21:48:15 +0200
committerSven Gothel <[email protected]>2023-04-20 21:48:15 +0200
commitc21082a5d7caf0ae6e29144358b4b4a1eafec019 (patch)
treeb302c82c1c14896f5c55d7ce54b72b8a0ec6046b /src/demos
parenta251f5734cc1f5c907f239c3ca3a4f1d4c262058 (diff)
Graph GLRegion/TextRegionUtil: Enhance pre-determination of buffer-size, increase default initial 16->64 (unsued)
- Region.countOutlineShape(..) now returns unpatched 3*triangle value for indices, avoiding grow - TextRegionUtil.addStringToRegion() uses countStringRegion(..) per default - Added GLRegion.create(.., OutlineShape) for convenience, using Region.countOutlineShape(..) - Refined API doc -
Diffstat (limited to 'src/demos')
-rw-r--r--src/demos/com/jogamp/opengl/demos/av/MovieCube.java2
-rw-r--r--src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java13
-rw-r--r--src/demos/com/jogamp/opengl/demos/av/MovieSimple.java2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener00.java2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener01.java2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener10.java5
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java6
7 files changed, 15 insertions, 17 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/av/MovieCube.java b/src/demos/com/jogamp/opengl/demos/av/MovieCube.java
index e7e393e18..0be2c35ba 100644
--- a/src/demos/com/jogamp/opengl/demos/av/MovieCube.java
+++ b/src/demos/com/jogamp/opengl/demos/av/MovieCube.java
@@ -171,7 +171,7 @@ public class MovieCube implements GLEventListener {
// FIXME: Graph TextRenderer does not AA well w/o MSAA and FBO
super(rmode, MovieCube.this.textSampleCount);
this.setRendererCallbacks(RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
- regionFPS = GLRegion.create(glp, renderModes, null);
+ regionFPS = GLRegion.create(glp, renderModes, null, 0, 0);
System.err.println("RegionFPS "+Region.getRenderModeString(renderModes)+", sampleCount "+textSampleCount[0]+", class "+regionFPS.getClass().getName());
staticRGBAColor[0] = 0.1f;
staticRGBAColor[1] = 0.1f;
diff --git a/src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java b/src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java
index 5fd70f97c..3c3350061 100644
--- a/src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java
+++ b/src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java
@@ -141,16 +141,12 @@ public class MovieSBSStereo implements StereoGLEventListener {
private final float fontSize = 1f; // 0.01f;
private final GLRegion regionFPS;
- InfoTextRendererGLELBase(final GLProfile glp, final int rmode, final boolean lowPerfDevice) {
+ InfoTextRendererGLELBase(final GLProfile glp, final int rmode) {
// FIXME: Graph TextRenderer does not AA well w/o MSAA and FBO
super(rmode, textSampleCount);
this.setRendererCallbacks(RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
- if( lowPerfDevice ) {
- regionFPS = null;
- } else {
- regionFPS = GLRegion.create(glp, renderModes, null);
- System.err.println("RegionFPS "+Region.getRenderModeString(renderModes)+", sampleCount "+textSampleCount[0]+", class "+regionFPS.getClass().getName());
- }
+ regionFPS = GLRegion.create(glp, renderModes, null, 0, 0);
+ System.err.println("RegionFPS "+Region.getRenderModeString(renderModes)+", sampleCount "+textSampleCount[0]+", class "+regionFPS.getClass().getName());
staticRGBAColor[0] = 0.9f;
staticRGBAColor[1] = 0.9f;
staticRGBAColor[2] = 0.9f;
@@ -545,9 +541,8 @@ public class MovieSBSStereo implements StereoGLEventListener {
surfHeight = window.getSurfaceHeight();
}
final int rmode = drawable.getChosenGLCapabilities().getSampleBuffers() ? 0 : Region.VBAA_RENDERING_BIT;
- final boolean lowPerfDevice = gl.isGLES();
if( enableTextRendererGLEL ) {
- textRendererGLEL = new InfoTextRendererGLELBase(gl.getGLProfile(), rmode, lowPerfDevice);
+ textRendererGLEL = new InfoTextRendererGLELBase(gl.getGLProfile(), rmode);
textRendererGLEL.init(drawable);
} else {
textRendererGLEL = null;
diff --git a/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java b/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java
index 6a5e932b9..deed019d1 100644
--- a/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java
+++ b/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java
@@ -126,7 +126,7 @@ public class MovieSimple implements GLEventListener {
// FIXME: Graph TextRenderer does not AA well w/o MSAA and FBO
super(rmode, textSampleCount);
this.setRendererCallbacks(RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
- regionFPS = GLRegion.create(glp, renderModes, null);
+ regionFPS = GLRegion.create(glp, renderModes, null, 0, 0);
System.err.println("RegionFPS "+Region.getRenderModeString(renderModes)+", sampleCount "+textSampleCount[0]+", class "+regionFPS.getClass().getName());
staticRGBAColor[0] = 0.9f;
staticRGBAColor[1] = 0.9f;
diff --git a/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener00.java b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener00.java
index 6cb19101c..1ec894d15 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener00.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener00.java
@@ -91,7 +91,7 @@ public class GPURegionGLListener00 extends GPURendererListenerBase01 {
outlineShape.addVertex(offset+10.0f,0.0f, true);
outlineShape.closeLastOutline(true);
- region = GLRegion.create(glp, getRenderModes(), null);
+ region = GLRegion.create(glp, getRenderModes(), null, outlineShape);
region.addOutlineShape(outlineShape, null, region.hasColorChannel() ? getRenderer().getRenderState().getColorStatic(new Vec4f()) : null);
}
diff --git a/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener01.java b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener01.java
index 404e502cf..fd1ba4df3 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener01.java
@@ -272,7 +272,7 @@ public class GPURegionGLListener01 extends GPURendererListenerBase01 {
createTestOutline01();
break;
}
- region = GLRegion.create(gl.getGLProfile(), getRenderModes(), null);
+ region = GLRegion.create(gl.getGLProfile(), getRenderModes(), null, outlineShape);
region.addOutlineShape(outlineShape, null, region.hasColorChannel() ? getRenderer().getRenderState().getColorStatic(new Vec4f()) : null);
}
diff --git a/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener10.java b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener10.java
index 6024b1410..f23d15b24 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener10.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener10.java
@@ -38,6 +38,7 @@ import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.GLRegion;
import com.jogamp.graph.curve.opengl.RenderState;
import com.jogamp.graph.curve.opengl.RegionRenderer;
@@ -73,6 +74,7 @@ public class GPURegionGLListener10 extends GPURendererListenerBase01 {
shape.addVertex(10.0f,0.0f, true);
shape.addVertex(5.0f,0.0f, false);
shape.closeLastOutline(true);
+ final int[/*2*/] vertIndexCount = Region.countOutlineShape(shape, new int[2]);
/** Same shape as above but without any off-curve vertices */
shape = new OutlineShape();
@@ -92,8 +94,9 @@ public class GPURegionGLListener10 extends GPURendererListenerBase01 {
shape.addVertex(offset+10.0f,-5.0f, true);
shape.addVertex(offset+10.0f,0.0f, true);
shape.closeLastOutline(true);
+ Region.countOutlineShape(shape, vertIndexCount);
- region = GLRegion.create(glp, getRenderModes(), null);
+ region = GLRegion.create(glp, getRenderModes(), null, vertIndexCount[0], vertIndexCount[1]);
region.addOutlineShapes(outlineShapes, null, null);
}
diff --git a/src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java b/src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java
index 9685f2cf9..26feafa5a 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java
@@ -156,9 +156,9 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
renderModes, debug, trace);
this.getRenderer().getRenderState().setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
this.textRegionUtil = new TextRegionUtil(renderModes);
- this.regionFPS = GLRegion.create(glp, renderModes, null);
- this.regionHead = GLRegion.create(glp, renderModes, null);
- this.regionBottom = GLRegion.create(glp, renderModes, null);
+ this.regionFPS = GLRegion.create(glp, renderModes, null, 0, 0);
+ this.regionHead = GLRegion.create(glp, renderModes, null, 0, 0);
+ this.regionBottom = GLRegion.create(glp, renderModes, null, 0, 0);
setFontSet(fontSet, FontSet.FAMILY_LIGHT, FontSet.STYLE_NONE);
setMatrix(0, 0, 0, 0f, sampleCount);
}