28package com.jogamp.opengl.demos.graph.ui;
31import java.io.IOException;
32import java.util.ArrayList;
34import java.util.Locale;
36import com.jogamp.common.os.Clock;
37import com.jogamp.common.util.IOUtil;
38import com.jogamp.graph.curve.OutlineShape;
39import com.jogamp.graph.curve.Region;
40import com.jogamp.graph.font.Font;
41import com.jogamp.graph.font.Font.Glyph;
42import com.jogamp.graph.font.FontFactory;
43import com.jogamp.graph.font.FontScale;
44import com.jogamp.graph.ui.Group;
45import com.jogamp.graph.ui.Scene;
46import com.jogamp.graph.ui.Shape;
47import com.jogamp.graph.ui.TooltipShape;
48import com.jogamp.graph.ui.TooltipText;
49import com.jogamp.graph.ui.layout.Alignment;
50import com.jogamp.graph.ui.layout.BoxLayout;
51import com.jogamp.graph.ui.layout.Gap;
52import com.jogamp.graph.ui.layout.GridLayout;
53import com.jogamp.graph.ui.layout.Margin;
54import com.jogamp.graph.ui.layout.Padding;
55import com.jogamp.graph.ui.shapes.GlyphShape;
56import com.jogamp.graph.ui.shapes.Label;
57import com.jogamp.graph.ui.shapes.Rectangle;
58import com.jogamp.graph.ui.widgets.RangeSlider;
59import com.jogamp.graph.ui.widgets.RangedGroup;
60import com.jogamp.graph.ui.widgets.RangedGroup.SliderParam;
61import com.jogamp.math.FloatUtil;
62import com.jogamp.math.Vec2f;
63import com.jogamp.math.Vec3f;
64import com.jogamp.math.Vec4f;
65import com.jogamp.math.geom.AABBox;
66import com.jogamp.newt.event.KeyAdapter;
67import com.jogamp.newt.event.KeyEvent;
68import com.jogamp.newt.event.MouseEvent;
69import com.jogamp.newt.event.WindowAdapter;
70import com.jogamp.newt.event.WindowEvent;
71import com.jogamp.newt.opengl.GLWindow;
72import com.jogamp.opengl.GL;
73import com.jogamp.opengl.GLAutoDrawable;
74import com.jogamp.opengl.GLCapabilities;
75import com.jogamp.opengl.GLCapabilitiesImmutable;
76import com.jogamp.opengl.GLEventAdapter;
77import com.jogamp.opengl.GLProfile;
78import com.jogamp.opengl.demos.graph.FontSetDemos;
79import com.jogamp.opengl.demos.util.CommandlineOptions;
80import com.jogamp.opengl.demos.util.MiscUtils;
81import com.jogamp.opengl.util.Animator;
100 private static final float GlyphGridWidth = 3/4f;
101 private static final float GlyphGridBorderThickness = 0.02f;
102 private static final Vec4f GlyphGridBorderColorComplex =
new Vec4f(0.2f, 0.2f, 0.2f, 1);
103 private static final Vec4f GlyphGridBorderColorSimple =
new Vec4f(0.2f, 0.2f, 0.7f, 1);
109 static int max_glyph_count = 10000;
111 private static boolean VERBOSE_GLYPHS =
false;
112 private static boolean VERBOSE_UI =
false;
114 public static void main(
final String[] args)
throws IOException {
115 float mmPerCell = 8f;
116 String fontFilename =
null;
117 int gridColumns = -1;
118 boolean showUnderline =
false;
119 boolean showLabel =
false;
120 boolean perfanal =
false;
122 if( 0 != args.length ) {
123 final int[] idx = { 0 };
124 for (idx[0] = 0; idx[0] < args.length; ++idx[0]) {
125 if( options.
parse(args, idx) ) {
127 }
else if(args[idx[0]].equals(
"-font")) {
129 fontFilename = args[idx[0]];
130 }
else if(args[idx[0]].equals(
"-mmPerCell")) {
133 }
else if(args[idx[0]].equals(
"-gridCols")) {
136 }
else if(args[idx[0]].equals(
"-showUnderline")) {
137 showUnderline =
true;
138 }
else if(args[idx[0]].equals(
"-showLabel")) {
140 }
else if(args[idx[0]].equals(
"-perf")) {
142 }
else if(args[idx[0]].equals(
"-max")) {
144 max_glyph_count =
MiscUtils.
atoi(args[idx[0]], max_glyph_count);
148 System.err.println(options);
151 if(
null == fontFilename ) {
152 font =
FontFactory.
get(IOUtil.getResource(
"fonts/freefont/FreeSerif.ttf",
165 System.out.println(
"Requested: " + reqCaps);
184 public void windowDestroyNotify(
final WindowEvent e) {
188 animator.
add(window);
198 final int glyphGridRowsPerPage;
202 System.err.println(
"DPI "+dpi[0]+
" x "+dpi[1]+
", "+ppmm[0]+
" x "+ppmm[1]+
" pixel/mm");
206 System.err.println(
"HiDPI PixelScale: "+hasSurfacePixelScale1[0]+
"x"+hasSurfacePixelScale1[1]+
" (has)");
207 System.err.println(
"mmPerCell "+mmPerCell);
208 glyphGridRowsPerPage = (int)( ( window.
getSurfaceHeight() / ppmm[1] ) / mmPerCell );
209 if( 0 >= gridColumns ) {
210 gridColumns = (int)( ( window.
getSurfaceWidth() * GlyphGridWidth / ppmm[0] ) / mmPerCell );
213 final float glyphGridCellSize = GlyphGridWidth / gridColumns;
214 final Vec2f glyphGridSize =
new Vec2f(GlyphGridWidth, glyphGridRowsPerPage * glyphGridCellSize);
219 final long t0 = Clock.currentNanos();
221 final GridDim gridDim =
new GridDim(font, gridColumns, glyphGridRowsPerPage, 1);
222 final Vec2f glyphGridTotalSize =
new Vec2f(glyphGridSize.x(), gridDim.rows * glyphGridCellSize);
223 System.err.println(gridDim);
224 System.err.println(
"GlyphGrid[pgsz "+glyphGridSize+
", totsz "+glyphGridTotalSize+
", cellSz "+glyphGridCellSize+
"]");
226 final int[] lastCodepoint = { gridDim.contourChars.get(0) };
227 final Group mainView;
228 final Shape.PointerListener glyphPointerListener;
232 glyphShapeHolder.
setName(
"GlyphShapeHolderInfo");
233 glyphShapeBox.
addShape( glyphShapeHolder );
237 setGlyphInfo(fontStatus, glyphInfo, font.
getGlyph(
'A' ));
238 glyphInfo.
setColor(0.1f, 0.1f, 0.1f, 1.0f);
252 final GlyphShape old = (GlyphShape) glyphShapeHolder.getShapeByIdx(0);
254 if( old.getGlyph().getCodepoint() == g0.getGlyph().getCodepoint() ) {
258 glyphShapeHolder.removeShape(old);
268 setGlyphInfo(fontStatus, glyphInfo, g0.
getGlyph());
278 new Gap(glyphGridCellSize*0.1f)));
280 addGlyphs(reqCaps.
getGLProfile(), font, glyphGrid, gridDim, showUnderline, showLabel, fontStatus, fontInfo, glyphPointerListener);
284 System.err.println(
"GlyphGrid "+glyphGrid);
285 System.err.println(
"GlyphGrid "+glyphGrid.
getLayout());
288 final GlyphShape gs = getGlyphShape( glyphGrid );
290 glyphShapeHolder.addShape(gs);
295 new SliderParam(
new Vec2f(glyphGridCellSize/4f, glyphGridSize.y()), glyphGridCellSize/10f,
true ) );
300 final float row_f = val / glyphGridCellSize;
301 System.err.println(
"VertSlider: row["+row_f+
".."+(row_f+gridDim.rowsPerPage-1)+
"]/"+gridDim.rows+
302 ", val["+old_val+
" -> "+val+
"]/"+minmax.y()+
", pct["+(100*old_val_pct)+
"% -> "+(100*val_pct)+
"%], cellSz "+glyphGridCellSize);
310 System.err.println(
"GlyphView "+glyphView);
315 final float infoCellWidth = ( 1f - glyphGridSize.x() ) * 1.15f;
316 final float infoCellHeight = glyphGridSize.y() * 0.5f;
319 infoGrid.
addShape(glyphShapeBox.setBorder(0.005f).setBorderColor(0, 0, 0, 1));
320 infoGrid.
addShape(glyphInfoBox.setBorder(0.005f).setBorderColor(0, 0, 0, 1));
323 System.err.println(
"InfoGrid "+infoGrid);
324 System.err.println(
"InfoGrid "+infoGrid.
getLayout());
325 System.err.println(
"GlyphShapeBox "+glyphShapeBox);
332 System.err.println(
"GlyphInfoGrid "+glyphInfoView);
333 System.err.println(
"GlyphInfoGrid "+glyphInfoView.
getLayout());
339 final String infoHelp =
"Click on a Glyph for a big tooltip view.\n"+
340 "Key-Up/Down or Slider-Mouse-Scroll to move through glyphs.\n"+
341 "Page-Up/Down or Control + Slider-Mouse-Scroll to page faster.\n"+
342 "Mouse-Scroll over left-half of Window rotates and holding control zooms.";
344 infoLabel.
setColor(0.1f, 0.1f, 0.1f, 1f);
347 final float h = glyphGridCellSize * 0.4f;
361 public void mouseWheelMoved(
final MouseEvent e) {
369 final float s = 1f+r/200f;
374 mainView.
scale(s, s, 1);
376 mainView.
move(s1.x()*dw/2f, s1.y()*dh/2f, 0);
377 System.err.println(
"scale +"+s+
" = "+s1);
382 final float tmp = rot.x(); rot.
setX( rot.y() ); rot.
setY( tmp );
390 System.err.println(
"MainView "+mainView);
391 System.err.println(
"MainView "+mainView.
getLayout());
394 scene.addShape(mainView);
399 public void keyReleased(
final KeyEvent e) {
404 printScreenOnGLThread(scene, window.getChosenGLCapabilities(), font, lastCodepoint[0]);
410 scene.waitUntilDisplayed();
412 final AABBox sceneBox = scene.
getBounds();
413 final AABBox mainViewBox = mainView.getBounds();
414 final float sx = sceneBox.
getWidth() / mainViewBox.getWidth();
415 final float sy = sceneBox.getHeight() / mainViewBox.getHeight();
416 final float sxy = Math.min(sx, sy);
417 System.err.println(
"SceneBox "+sceneBox);
418 System.err.println(
"MainViewBox "+mainViewBox);
419 System.err.println(
"scale sx "+sx+
", sy "+sy+
", sxy "+sxy);
420 mainView.scale(sxy, sxy, 1f).moveTo(sceneBox.getLow());
421 final long t1 = Clock.currentNanos();
422 final long total = t1 - t0;
423 final float nsPerGlyph = total / gridDim.glyphCount;
424 System.err.println(
"PERF: Total took "+(total/1000000.0)+
"ms, per-glyph "+(nsPerGlyph/1000000.0)+
"ms, glyphs "+gridDim.glyphCount);
426 printScreenOnGLThread(scene, window.getChosenGLCapabilities(), font, lastCodepoint[0]);
428 OutlineShape.printPerf(System.err);
431 static void printScreenOnGLThread(
final Scene scene,
final GLCapabilitiesImmutable caps,
final Font font,
final int codepoint) {
432 final String fn = font.getFullFamilyName().replace(
' ',
'_').replace(
'-',
'_');
433 scene.screenshot(
true, scene.nextScreenshotFile(
null, FontView01.class.getSimpleName(), options.
renderModes, caps, fn+
"_cp"+Integer.toHexString(codepoint)));
436 static class GridDim {
437 final List<Character> contourChars;
438 final int glyphCount;
440 final int columnsNet;
442 final int rowsPerPage;
444 int complexGlyphCount;
447 public GridDim(
final Font font,
final int columns,
final int rowsPerPage,
final int xReserved) {
448 this.contourChars =
new ArrayList<Character>();
449 this.glyphCount = scanContourGlyphs(font);
450 this.columns = columns;
451 this.columnsNet = columns - xReserved;
452 this.rows = (int)Math.ceil((
double)glyphCount / (double)columnsNet);
453 this.rowsPerPage = rowsPerPage;
454 this.elemCount = glyphCount + ( rows * xReserved );
458 public int reserverColumns() {
return columns - columnsNet; }
460 private int scanContourGlyphs(
final Font font) {
461 final long t0 = Clock.currentNanos();
462 contourChars.clear();
463 complexGlyphCount = 0;
465 final int[] max = { max_glyph_count };
466 font.forAllGlyphs((
final Glyph fg) -> {
467 if( !fg.isNonContour() && max[0]-- > 0 ) {
468 contourChars.add( fg.getCodepoint() );
469 if( null != fg.getShape() && fg.getShape().isComplex() ) {
472 maxNameLen = Math.max(maxNameLen, fg.getName().length());
475 final long t1 = Clock.currentNanos();
476 final long total = t1 - t0;
477 final float nsPerGlyph = total / contourChars.size();
478 System.err.println(
"PERF: GlyphScan took "+(total/1000000.0)+
"ms, per-glyph "+(nsPerGlyph/1000000.0)+
"ms, glyphs "+contourChars.size());
479 return contourChars.size();
482 public String toString() {
return "GridDim[contours "+glyphCount+
", complex "+complexGlyphCount+
" ("+((float)complexGlyphCount/(
float)glyphCount)*100+
"%), "+columns+
"x"+rows+
"="+(columns*rows)+
">="+elemCount+
", rows/pg "+rowsPerPage+
"]"; }
485 static Group getGlyphShapeHolder(
final Shape shape0) {
486 if( !( shape0 instanceof Group ) ) {
489 return (Group)((Group)shape0).getShapeByName(
"GlyphHolder");
491 static GlyphShape getGlyphShape(
final Shape shape0) {
492 final Group gsh = getGlyphShapeHolder(shape0);
493 if(
null != gsh && gsh.getShapeCount() > 0 ) {
494 return (GlyphShape) gsh.getShapeByIdx(0);
503 static void addGlyphs(
final GLProfile glp,
final Font font,
final Group sink,
504 final GridDim gridDim,
final boolean showUnderline,
final boolean showLabel,
505 final Font fontStatus,
final Font fontInfo,
final Shape.PointerListener glyphPointerListener) {
506 final AABBox tmpBox =
new AABBox();
507 final long t0 = Clock.currentNanos();
509 for(
int idx = 0; idx < gridDim.glyphCount; ++idx) {
510 final char codepoint = gridDim.contourChars.get(idx);
511 final Font.Glyph fg = font.getGlyph(codepoint);
512 final boolean isComplex =
null != fg.getShape() ? fg.getShape().isComplex() :
false;
514 final GlyphShape g =
new GlyphShape(options.
renderModes, fg, 0, 0);
515 g.setColor(0.1f, 0.1f, 0.1f, 1).setName(
"GlyphShape");
516 g.setInteractive(
false).setDragAndResizable(
false);
517 g.setName(
"cp_0x"+Integer.toHexString(fg.getCodepoint()) );
519 final Group c0 =
new Group(
"GlyphHolder",
null,
null, g);
520 c0.setInteractive(
false).setDragAndResizable(
false);
523 final AABBox gbox = fg.getBounds(tmpBox);
524 final boolean addUnderline = showUnderline && gbox.getMinY() < 0f;
525 final Group c1 =
new Group(
new BoxLayout( 1f, 1f, addUnderline ? Alignment.None : Alignment.Center) );
526 c1.setBorder(GlyphGridBorderThickness).setBorderColor(isComplex ? GlyphGridBorderColorComplex : GlyphGridBorderColorSimple)
527 .setInteractive(
true).setDragAndResizable(
false).setName(
"GlyphHolder2");
529 final Shape underline =
new Rectangle(options.
renderModes, 1f, gbox.getMinY(), 0.01f).setInteractive(
false).setColor(0f, 0f, 1f, 0.25f);
530 c1.addShape(underline);
534 c1.onHover(glyphPointerListener);
535 sink.receiveKeyEvents(c1);
537 c1.setToolTip(
new TooltipShape(
new Vec4f(1, 1, 1, 1),
new Vec4f(0, 0, 0, 1), 0.01f,
538 new Padding(0.05f),
new Vec2f(14,14), 0, options.
renderModes,
539 g, TooltipShape.NoOpDtor) );
540 c1.onClicked((
final Shape s,
final Vec3f pos,
final MouseEvent e) -> {
541 c1.getTooltip().now();
544 if( 0 < gridDim.reserverColumns() && 0 == idx % gridDim.columnsNet ) {
545 addLabel(sink, fontStatus, String.format(
"%04x", (
int)codepoint));
548 final Group c2 =
new Group(
new GridLayout( 1, 0, 0, Alignment.None) );
549 c2.addShape(c1.setName(
"GlyphHolder3"));
551 final Label l =
new Label(options.
renderModes, fontInfo, fg.getName());
553 final float sxy = 1f/7f;
554 c2.addShape( l.scale(sxy, sxy, 1).setColor(0, 0, 0, 1).setInteractive(
false).setDragAndResizable(
false) );
563 final long t1 = Clock.currentNanos();
564 final long total = t1 - t0;
565 final float nsPerGlyph = total / gridDim.glyphCount;
566 System.err.println(
"PERF: GlyphAdd took "+(total/1000000.0)+
"ms, per-glyph "+(nsPerGlyph/1000000.0)+
"ms, glyphs "+gridDim.glyphCount);
568 static void addLabel(
final Group c,
final Font font,
final String text) {
569 c.addShape(
new Label(options.
renderModes, font, text).setColor(0, 0, 0, 1).setInteractive(
false).setDragAndResizable(
false) );
572 static void setGlyphInfo(
final Font font,
final Label label,
final Font.Glyph g) {
573 label.setText( getGlyphInfo(g) );
574 if( VERBOSE_GLYPHS ) {
575 System.err.println( label.getText() );
579 static String getGlyphInfo(
final Font.Glyph g) {
580 final OutlineShape os = g.getShape();
581 final boolean isComplex =
null != os ? os.isComplex() :
false;
582 final int osVertices =
null != os ? os.getVertexCount() : 0;
583 final String name_s =
null != g.getName() ? g.getName() :
"";
584 final AABBox bounds = g.getBounds();
585 final String box_s = String.format(
"Box %+.3f/%+.3f%n %+.3f/%+.3f", bounds.getLow().x(), bounds.getLow().y(), bounds.getHigh().x(), bounds.getHigh().y());
586 return String.format((Locale)
null,
"%s%nHeight: %1.3f%nLine Height: %1.3f%n%nSymbol: %04x, id %04x%nName: '%s'%nDim %1.3f x %1.3f%n%s%nAdvance %1.3f%nLS Bearings: %1.3f%nVertices: %03d%n%s",
587 g.getFont().getFullFamilyName(),
588 g.getFont().getMetrics().getAscent() - g.getFont().getMetrics().getDescent(),
589 g.getFont().getLineHeight(),
590 (
int)g.getCodepoint(), g.getID(), name_s,
591 bounds.getWidth(), bounds.getHeight(), box_s,
593 g.getLeftSideBearings(),
594 osVertices, isComplex?
"Complex Shape":
"Simple Shape");
Abstract Outline shape representation define the method an OutlineShape(s) is bound and rendered.
static final int NORM_RENDERING_BIT
Rendering-Mode bit for Region.
The optional property jogamp.graph.font.ctor allows user to specify the FontConstructor implementatio...
static final FontSet get(final int font)
static final int UBUNTU
Ubuntu is the default font family, {@value}.
Simple static font scale methods for unit conversions.
static float[] ppmmToPPI(final float[] ppmm)
Converts [1/mm] to [1/inch] in place.
Group of Shapes, optionally utilizing a Group.Layout.
int getShapeCount()
Returns number of Shapes, see getShapes().
void addShape(final Shape s)
Adds a Shape.
Layout getLayout()
Return current Group.Layout.
AABBox getBounds(final PMVMatrix4f pmv, final Shape shape)
Returns AABBox dimension of given Shape from this container's perspective, i.e.
void setRelayoutOnDirtyShapes(final boolean v)
Set relayout on dirty shapes mode, defaults to true.
final void setClearParams(final float[] clearColor, final int clearMask)
Sets the clear parameter for glClearColor(..) and glClear(..) to be issued at display(GLAutoDrawable)...
final void setPMvCullingEnabled(final boolean v)
Enable or disable Project-Modelview (PMv) frustum culling per Shape for this container.
void addGLEventListener(final GLEventListener listener)
synchronized void attachInputListenerTo(final GLWindow window)
boolean invoke(final boolean wait, final GLRunnable glRunnable)
Enqueues a one-shot GLRunnable, which will be executed within the next GLAutoDrawable#display() call ...
String getStatusText(final GLAutoDrawable glad, final int renderModes, final float dpi)
Return a formatted status string containing avg fps and avg frame duration.
Convenient adapter combining dummy implementation for MouseListener and GestureListener.
Generic Shape, potentially using a Graph via GraphShape or other means of representing content.
Tooltip setToolTip(final Tooltip newTooltip)
Set's a new Tooltip for this shape.
Shape setColor(final float r, final float g, final float b, final float a)
Set base color.
Shape setName(final String name)
Set a symbolic name for this shape for identification.
final Shape addKeyListener(final KeyListener l)
final Shape move(final float dtx, final float dty, final float dtz)
Move about scaled distance.
final Shape setInteractive(final boolean v)
Set whether this shape is interactive in general, i.e.
final Vec3f getScale()
Returns scale Vec3f reference.
final AABBox getBounds()
Returns the unscaled bounding AABBox for this shape, borrowing internal instance.
final Quaternion getRotation()
Returns Quaternion for rotation.
final Shape setDragAndResizable(final boolean v)
Set whether this shape is draggable and resizable.
final Shape validate(final GL2ES2 gl)
Validates the shape's underlying GLRegion.
final Shape setPaddding(final Padding padding)
Sets the unscaled padding for this shape, which is included in unscaled getBounds() and also includes...
final Shape setRotation(final Quaternion q)
Sets the rotation Quaternion.
final Shape scale(final Vec3f s)
Multiply current scale factor by given scale.
final Shape setToggleable(final boolean toggleable)
Set this shape toggleable, default is off.
A round HUD text Tooltip for Shape, see Shape#setToolTip(Tooltip).
Immutable layout alignment options, including Bit#Fill.
static final Alignment None
No alignment constant.
static final Alignment FillCenter
Bit#Fill, Bit#CenterHoriz and Bit#CenterVert alignment constant.
GraphUI Stack Group.Layout.
GraphUI CSS property Gap, scaled spacing between (grid) cells not belonging to the cell element.
GraphUI Grid Group.Layout.
GraphUI CSS property Margin, scaled space between or around elements and not included in the element'...
GraphUI CSS property Padding, unscaled space belonging to the element and included in the element's s...
Representing a single Font.Glyph as a GraphShape.
Glyph getGlyph()
Returns the Font.Glyph to be rendered.
A GraphUI text label GraphShape.
boolean setText(final CharSequence text)
Set the text to be rendered.
Basic Float math utility functions.
static final float PI
The value PI, i.e.
final Quaternion rotateByEuler(final Vec3f angradXYZ)
Rotates this quaternion from the given Euler rotation array angradXYZ in radians.
2D Vector based upon two float components.
3D Vector based upon three float components.
Vec3f scale(final float s)
this = this * s, returns this.
4D Vector based upon four float components.
Axis Aligned Bounding Box.
final AABBox scale(final float s)
Scale this AABBox by a constant around fixed center.
static final short VK_F4
Constant for the F4 function key.
static final short VK_ESCAPE
Constant for the ESCAPE function key.
final short getKeySymbol()
Returns the virtual key symbol reflecting the current keyboard layout.
static final short VK_S
See VK_A.
static final short VK_Q
See VK_A.
Pointer event of type PointerType.
final float[] getRotation()
Returns a 3-component float array filled with the values of the rotational axis in the following orde...
final int getX()
See details for multiple-pointer events.
final void setConsumed(final boolean consumed)
If consumed is true, this event is marked as consumed, ie.
NEWT Window events are provided for notification purposes ONLY.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final int getSurfaceHeight()
Returns the height of this GLDrawable's surface client area in pixel units.
final void addMouseListener(final MouseListener l)
Appends the given MouseListener to the end of the list.
final void setTitle(final String title)
final float[] getPixelsPerMM(final float[] ppmmStore)
Returns the pixels per millimeter of this window's NativeSurface according to the main monitor's curr...
final float[] getCurrentSurfaceScale(final float[] result)
Returns the current pixel scale of the associated NativeSurface.
final int getSurfaceWidth()
Returns the width of this GLDrawable's surface client area in pixel units.
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
final void addWindowListener(final WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Specifies a set of OpenGL capabilities.
final GLProfile getGLProfile()
Returns the GL profile you desire or used by the drawable.
This may become a little font viewer application, having FontForge as its role model.
static void main(final String[] args)
GLCapabilities getGLCaps()
int graphAASamples
Sample count for Graph Region AA render-modes: Region#VBAA_RENDERING_BIT or Region#MSAA_RENDERING_BIT...
int graphAAQuality
Pass2 AA-quality rendering for Graph Region AA render-modes: VBAA_RENDERING_BIT.
void parse(final String[] args)
static void waitForKey(final String preMessage)
static int atoi(final String str, final int def)
static void destroyWindow(final GLAutoDrawable glad)
static float atof(final String str, final float def)
final synchronized void add(final GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.
final void setUpdateFPSFrames(final int frames, final PrintStream out)
final synchronized boolean stop()
Stops this animator.
CenterVert
Vertical center alignment.
Fill
Scale object to parent size, e.g.
Font getDefault()
Returns the family FAMILY_REGULAR with STYLE_NONE as retrieved with get(int, int).
char getCodepoint()
Returns this glyph's mapped (unicode) codepoint symbol.
Interface wrapper for font implementation.
Glyph getGlyph(final String name)
Returns the Glyph mapped to given name.
String getFullFamilyName()
Shall return the family and subfamily name, separated a dash.
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
boolean invoke(boolean wait, GLRunnable glRunnable)
Enqueues a one-shot GLRunnable, which will be executed within the next display() call after all regis...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
GLCapabilitiesImmutable getChosenGLCapabilities()
Fetches the GLCapabilitiesImmutable corresponding to the chosen OpenGL capabilities (pixel format / v...
static final int GL_DEPTH_BUFFER_BIT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_DEPTH_BUFFER_BIT" wit...