diff options
author | Sven Gothel <[email protected]> | 2023-03-05 04:42:56 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-05 04:42:56 +0100 |
commit | d87f510194ad2eead2a42b41a3cbe1077f65a695 (patch) | |
tree | 80ab2b5bcfd55674e6310ed2ba5b96cf53d71daf /src/test/com/jogamp | |
parent | 8d4e039dfd490d3f2290523ea75c9f51460bae41 (diff) |
NEWT Screen: Allow injection of global (single) monitor size in [mm] via newt.ws.mmwidth and newt.ws.mmheight property
This is essential on bare-metal devices where the screen DRM/GBM driver does not provide the screen-size (in mm).
Otherwise we would have resolution/(size_mm=0) infinity density and none of our graph font demos would work,
as we compute pixel-em-size based using dpi and pixel-pt-size.
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java index 0c22ac43a..889f92a69 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java @@ -41,6 +41,7 @@ import com.jogamp.graph.font.Font; import com.jogamp.graph.font.FontFactory; import com.jogamp.graph.font.FontScale; import com.jogamp.graph.geom.SVertex; +import com.jogamp.newt.MonitorDevice; import com.jogamp.newt.event.KeyAdapter; import com.jogamp.newt.event.KeyEvent; import com.jogamp.newt.event.WindowAdapter; @@ -158,6 +159,8 @@ public class GPUTextNewtDemo { System.err.println("GPU Text Newt Demo: "+font2.fullString()); System.err.println("GPU Text Newt Demo: screen-dpi: "+sDPI[0]+"x"+sDPI[1]+", font "+font_ptpi+" pt, "+font_ppi+" pixel"); System.err.println("GPU Text Newt Demo: textX2: "+fontNameBox+" em, "+fontNameBox.scale(font_ppi, new float[3])+" px"); + final MonitorDevice monitor = window.getMainMonitor(); + System.err.println("GPU Text Newt Demo: "+monitor); // window.setSurfaceSize((int)(fontNameBox.getWidth()*1.1f), (int)(fontNameBox.getHeight()*2f)); } |