aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-02-05 12:21:08 +0100
committerSven Gothel <[email protected]>2023-02-05 12:21:08 +0100
commitdddb088571d2d5174ba68aa0a34ad62eaa06243a (patch)
tree1b85d252b6493fc52b0bd4253c3519f0f232614c /src
parent973bcfcfe5a0f147cf2e00deb50897f23989f26a (diff)
Graph: Fix Region/Text Renderer: Add RegionRenderer enable/disable for blending stubs in display (Mesa3D results are otherwise broken)
Diffstat (limited to 'src')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java3
3 files changed, 11 insertions, 0 deletions
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 ed84414d9..73952684e 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
@@ -95,6 +95,7 @@ public class GPURegionGLListener01 extends GPURendererListenerBase01 {
region.addOutlineShape(outlineShape, null, region.hasColorChannel() ? getRenderer().getRenderState().getColorStatic(new float[4]) : null);
}
+ @Override
public void init(final GLAutoDrawable drawable) {
super.init(drawable);
@@ -110,6 +111,7 @@ public class GPURegionGLListener01 extends GPURendererListenerBase01 {
createTestOutline();
}
+ @Override
public void display(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
@@ -125,6 +127,8 @@ public class GPURegionGLListener01 extends GPURendererListenerBase01 {
if( weight != regionRenderer.getRenderState().getWeight() ) {
regionRenderer.getRenderState().setWeight(weight);
}
+ regionRenderer.enable(gl, true);
region.draw(gl, regionRenderer, getSampleCount());
+ regionRenderer.enable(gl, false);
}
}
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 1660cef4d..d79bbb970 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
@@ -97,6 +97,7 @@ public class GPURegionGLListener02 extends GPURendererListenerBase01 {
region.addOutlineShapes(outlineShapes, null, null);
}
+ @Override
public void init(final GLAutoDrawable drawable) {
super.init(drawable);
@@ -112,6 +113,7 @@ public class GPURegionGLListener02 extends GPURendererListenerBase01 {
createTestOutline();
}
+ @Override
public void display(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
@@ -128,7 +130,9 @@ public class GPURegionGLListener02 extends GPURendererListenerBase01 {
if( weight != regionRenderer.getRenderState().getWeight() ) {
regionRenderer.getRenderState().setWeight(weight);
}
+ regionRenderer.enable(gl, true);
region.draw(gl, regionRenderer, getSampleCount());
+ regionRenderer.enable(gl, false);
}
}
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 945204052..85d1b5290 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
@@ -227,6 +227,8 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
final float pixelSizeHead = font.getPixelSize(fontSizeHead, dpiH);
final float pixelSizeBottom = font.getPixelSize(fontSizeBottom, dpiH);
+ renderer.enable(gl, true);
+
if( drawFPS ) {
final float pixelSizeFPS = font.getPixelSize(fontSizeFPS, dpiH);
final float lfps, tfps, td;
@@ -303,6 +305,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
textRegionUtil.drawString3D(gl, renderer, font, nearPlaneS * pixelSizeBottom, userString.toString(), null, getSampleCount());
}
}
+ renderer.enable(gl, false);
}
final boolean bottomTextUseFrustum = true;