From a798d6bcbdccebe58d3a46ce07aedb574a15ef51 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 14 Apr 2023 18:17:59 +0200 Subject: GraphUI Demo FontView01: Add screenshot per selected Glyph --- .../com/jogamp/opengl/demos/graph/ui/FontView01.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/demos/com/jogamp/opengl') diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java index 18a6c77d4..daf125e87 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java @@ -136,6 +136,13 @@ public class FontView01 { }); animator.add(window); + final Scene scene = new Scene(); + scene.setClearParams(new float[] { 1f, 1f, 1f, 1f}, GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); + scene.setFrustumCullingEnabled(true); + + scene.attachInputListenerTo(window); + window.addGLEventListener(scene); + final float[] ppmm = window.getPixelsPerMM(new float[2]); { final float[] dpi = FontScale.ppmmToPPI( new float[] { ppmm[0], ppmm[1] } ); @@ -223,17 +230,12 @@ public class FontView01 { // glyphCont.markShapeDirty(); // grid.markShapeDirty(); System.err.println(); + scene.screenshot(true, scene.nextScreenshotFile(null, FontView01.class.getSimpleName(), options.renderModes, window.getChosenGLCapabilities(), null)); } }); mainGrid.addShape(c); } - final Scene scene = new Scene(); - scene.setClearParams(new float[] { 1f, 1f, 1f, 1f}, GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); - scene.setFrustumCullingEnabled(true); - - scene.attachInputListenerTo(window); - window.addGLEventListener(scene); animator.start(); scene.waitUntilDisplayed(); @@ -263,6 +265,7 @@ public class FontView01 { infoGrid.setScale(icScale, icScale, 1f); } scene.addShape(infoGrid); + scene.screenshot(true, scene.nextScreenshotFile(null, FontView01.class.getSimpleName(), options.renderModes, window.getChosenGLCapabilities(), null)); // stay open .. } -- cgit v1.2.3