29package com.jogamp.opengl.test.junit.jogl.demos.es1.newt;
31import com.jogamp.common.util.InterruptSource;
32import com.jogamp.newt.event.KeyAdapter;
33import com.jogamp.newt.event.KeyEvent;
34import com.jogamp.newt.opengl.GLWindow;
35import com.jogamp.opengl.test.junit.util.MiscUtils;
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.es1.GearsES1;
43import com.jogamp.opengl.GLCapabilities;
44import com.jogamp.opengl.GLProfile;
46import org.junit.Assert;
47import org.junit.BeforeClass;
48import org.junit.AfterClass;
50import org.junit.FixMethodOrder;
51import org.junit.runners.MethodSorters;
53@FixMethodOrder(MethodSorters.NAME_ASCENDING)
55 static int width, height;
56 static boolean forceES2 =
false;
57 static boolean forceFFPEmu =
false;
58 static int swapInterval = 1;
72 Assert.assertNotNull(glWindow);
73 glWindow.
setTitle(
"Gears NEWT Test");
89 final GLWindow f_glWindow = glWindow;
91 public void keyReleased(
final KeyEvent e) {
96 new InterruptSource.Thread() {
101 new InterruptSource.Thread() {
109 glWindow.
setSize(width, height);
115 while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.
getTotalFPSDuration()<duration) {
124 public void test00() throws InterruptedException {
126 runTestGL(caps, forceFFPEmu);
129 static long duration = 500;
131 public static void main(
final String args[]) {
132 for(
int i=0; i<args.length; i++) {
133 if(args[i].equals(
"-time")) {
136 duration = Integer.parseInt(args[i]);
137 }
catch (
final Exception ex) { ex.printStackTrace(); }
138 }
else if(args[i].equals(
"-vsync")) {
141 }
else if(args[i].equals(
"-es2")) {
143 }
else if(args[i].equals(
"-ffpemu")) {
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 a set of OpenGL capabilities.
Specifies the the OpenGL profile.
static final String GLES2
The embedded OpenGL profile ES 2.x, with x >= 0.
static GLProfile getGL2ES1(final AbstractGraphicsDevice device)
Returns the GL2ES1 profile implementation, hence compatible w/ GL2ES1.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu)
static void main(final String args[])
static void releaseClass()
void runTestGL(final GLCapabilities caps, final boolean forceFFPEmu)
static int atoi(final String str, final int def)
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.