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.UITestCase;
36import com.jogamp.opengl.test.junit.util.QuitAdapter;
38import com.jogamp.opengl.util.Animator;
40import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquareES1;
42import com.jogamp.opengl.GLCapabilities;
43import com.jogamp.opengl.GLProfile;
45import org.junit.Assert;
46import org.junit.BeforeClass;
47import org.junit.AfterClass;
49import org.junit.FixMethodOrder;
50import org.junit.runners.MethodSorters;
52@FixMethodOrder(MethodSorters.NAME_ASCENDING)
54 static int width, height;
55 static boolean forceES2 =
false;
56 static boolean forceFFPEmu =
false;
70 Assert.assertNotNull(glWindow);
71 glWindow.
setTitle(
"Gears NEWT Test");
87 final GLWindow f_glWindow = glWindow;
89 public void keyReleased(
final KeyEvent e) {
94 new InterruptSource.Thread() {
99 new InterruptSource.Thread() {
107 glWindow.
setSize(width, height);
113 while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.
getTotalFPSDuration()<duration) {
122 public void test00() throws InterruptedException {
124 runTestGL(caps, forceFFPEmu);
127 static long duration = 1000;
129 public static void main(
final String args[]) {
130 for(
int i=0; i<args.length; i++) {
131 if(args[i].equals(
"-time")) {
134 duration = Integer.parseInt(args[i]);
135 }
catch (
final Exception ex) { ex.printStackTrace(); }
136 }
else if(args[i].equals(
"-es2")) {
138 }
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[])
void runTestGL(final GLCapabilities caps, final boolean forceFFPEmu)
static void releaseClass()
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.