29package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
31import com.jogamp.common.util.InterruptSource;
32import com.jogamp.newt.event.KeyAdapter;
33import com.jogamp.newt.event.KeyEvent;
34import com.jogamp.newt.event.TraceWindowAdapter;
35import com.jogamp.newt.opengl.GLWindow;
36import com.jogamp.opengl.test.junit.util.UITestCase;
37import com.jogamp.opengl.test.junit.util.QuitAdapter;
39import com.jogamp.opengl.util.Animator;
41import com.jogamp.opengl.test.junit.jogl.demos.es2.ElektronenMultiplizierer;
43import com.jogamp.opengl.GLCapabilitiesImmutable;
44import com.jogamp.opengl.GLProfile;
46import org.junit.Assert;
47import org.junit.BeforeClass;
49import org.junit.FixMethodOrder;
50import org.junit.runners.MethodSorters;
56@FixMethodOrder(MethodSorters.NAME_ASCENDING)
58 static final int width = 640, height = 480;
60 static final String tRoutineClassName =
null;
61 static final boolean tMultiSampling =
false;
62 static final int tNumberOfSampleBuffers = -1;
63 static final boolean tAnisotropicFiltering =
false;
64 static final float tAnisotropyLevel = -1.0f;
65 static final boolean tFrameCapture =
false;
66 static final boolean tFrameSkip =
true;
67 static final int desiredFrameRate = 30;
68 static int startFrame = 1700;
69 static long duration = 5000;
74 if( ! ( glp.isHardwareRasterizer() && glp.
isGL2ES3() ) ) {
76 setTestSupported(
false);
81 protected void run() throws InterruptedException {
84 tMultiSampling,tNumberOfSampleBuffers,
85 tAnisotropicFiltering,tAnisotropyLevel,
87 tFrameSkip, desiredFrameRate, startFrame
92 Assert.assertNotNull(glWindow);
93 glWindow.
setSize(width, height);
94 glWindow.
setTitle(
"ElektronenMultiplizierer (GL2ES2/NEWT)");
106 final GLWindow f_glWindow = glWindow;
108 public void keyReleased(
final KeyEvent e) {
113 new InterruptSource.Thread() {
118 new InterruptSource.Thread() {
129 while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.
getTotalFPSDuration()<duration) {
141 public static void main(
final String args[]) {
142 for(
int i=0; i<args.length; i++) {
143 if(args[i].equals(
"-time")) {
146 duration = Integer.parseInt(args[i]);
147 }
catch (
final Exception ex) { ex.printStackTrace(); }
149 if(args[i].equals(
"-sframe")) {
152 startFrame = Integer.parseInt(args[i]);
153 }
catch (
final Exception ex) { ex.printStackTrace(); }
final char getKeyChar()
Returns the UTF-16 character reflecting the key symbol incl.
static boolean isPrintableKey(final short uniChar, final boolean isKeyChar)
Returns true if given uniChar represents a printable character, i.e.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final boolean isFullscreen()
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 boolean isUndecorated()
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final boolean setFullscreen(final boolean fullscreen)
Enable or disable fullscreen mode for this window.
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 setUndecorated(final boolean value)
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 the the OpenGL profile.
static GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
final boolean isGL2ES3()
Indicates whether this profile is capable of GL2ES3.
GLCapabilitiesImmutable getGLCapabilities()
void testElektronenMultiplizierer01()
static void main(final String args[])
final long getTotalFPSDuration()
final void setUpdateFPSFrames(final int frames, final PrintStream out)
final synchronized boolean start()
Starts this animator, if not running.
final synchronized boolean stop()
Stops this animator.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
Specifies an immutable set of OpenGL capabilities.