28package com.jogamp.opengl.demos.graph.ui;
30import java.io.IOException;
32import com.jogamp.common.util.InterruptSource;
33import com.jogamp.graph.curve.Region;
34import com.jogamp.graph.font.Font;
35import com.jogamp.graph.font.FontFactory;
36import com.jogamp.graph.font.FontSet;
37import com.jogamp.graph.ui.GraphShape;
38import com.jogamp.graph.ui.Scene;
39import com.jogamp.graph.ui.shapes.Button;
40import com.jogamp.math.Recti;
41import com.jogamp.math.geom.AABBox;
42import com.jogamp.math.util.PMVMatrix4f;
43import com.jogamp.newt.event.KeyAdapter;
44import com.jogamp.newt.event.KeyEvent;
45import com.jogamp.newt.event.WindowAdapter;
46import com.jogamp.newt.event.WindowEvent;
47import com.jogamp.newt.opengl.GLWindow;
48import com.jogamp.opengl.GL;
49import com.jogamp.opengl.GLCapabilities;
50import com.jogamp.opengl.GLProfile;
51import com.jogamp.opengl.demos.util.CommandlineOptions;
52import com.jogamp.opengl.util.Animator;
63 public static void main(
final String[] args)
throws IOException {
65 System.err.println(options);
67 System.err.println(
"GLProfile: "+reqGLP);
75 System.err.println(
"Shape bounds "+shape.
getBounds(reqGLP));
87 System.out.println(
"Requested: " + caps);
100 public void windowDestroyNotify(
final WindowEvent e) {
108 public void keyPressed(
final KeyEvent arg0) {
123 new InterruptSource.Thread( () -> { window.
destroy(); } ).start();
134 animator.
add(window);
138 static class MyPMVMatrixSetup
extends Scene.DefaultPMVMatrixSetup {
141 super.set(pmv, viewport);
145 setPlaneBox(planeBox0, pmv, viewport);
146 final float sx = planeBox0.
getWidth();
148 final float sxy = sx > sy ? sx : sy;
149 pmv.scaleP(sxy, sxy, 1f);
Abstract Outline shape representation define the method an OutlineShape(s) is bound and rendered.
static final int VBAA_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}.
Graph based GLRegion Shape.
void addShape(final Shape s)
Adds a Shape.
final void setClearParams(final float[] clearColor, final int clearMask)
Sets the clear parameter for glClearColor(..) and glClear(..) to be issued at display(GLAutoDrawable)...
int setSampleCount(final int v)
Sets RegionRenderer#setSampleCount(int).
int getSampleCount()
Returns RegionRenderer#getSampleCount().
int setAAQuality(final int v)
Sets RegionRenderer#setAAQuality(int).
final void setPMVMatrixSetup(final PMVMatrixSetup setup)
Set a custom PMVMatrixSetup.
synchronized void attachInputListenerTo(final GLWindow window)
int getAAQuality()
Returns RegionRenderer#getAAQuality().
final AABBox getBounds()
Returns the unscaled bounding AABBox for this shape, borrowing internal instance.
Rectangle with x, y, width and height integer components.
Axis Aligned Bounding Box.
PMVMatrix4f implements the basic computer graphics Matrix4f pack using projection (P),...
void setAlphaBits(final int alphaBits)
Sets the number of bits requested for the color buffer's alpha component.
static final short VK_RIGHT
Constant for the cursor- or numerical-pad right arrow key.
static final short VK_F4
Constant for the F4 function key.
static final short VK_ESCAPE
Constant for the ESCAPE function key.
static final short VK_UP
Constant for the cursor- or numerical-pad up arrow key.
static final short VK_LEFT
Constant for the cursor- or numerical-pad left arrow key.
final short getKeySymbol()
Returns the virtual key symbol reflecting the current keyboard layout.
static final short VK_DOWN
Constant for the cursor- or numerical pad down arrow key.
static final short VK_Q
See VK_A.
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 setTitle(final String title)
final void addKeyListener(final KeyListener l)
Appends the given com.jogamp.newt.event.KeyListener to the end of the list.
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.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
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.
Specifies the the OpenGL profile.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
Res independent Shape, Scene attached to GLWindow showing simple shape.
static void main(final String[] args)
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)
final synchronized void add(final GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.
final synchronized boolean start()
Starts this animator, if not running.
final synchronized boolean stop()
Stops this animator.
static final int FAMILY_LIGHT
Font family LIGHT, {@value}.
Font get(int family, int stylebits)
static final int STYLE_SERIF
SERIF style/family bit flag.
Interface wrapper for font implementation.
String getFullFamilyName()
Shall return the family and subfamily name, separated a dash.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
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...