29package com.jogamp.opengl.test.junit.jogl.demos.es1.newt;
31import com.jogamp.newt.opengl.GLWindow;
32import com.jogamp.opengl.test.junit.util.MiscUtils;
33import com.jogamp.opengl.test.junit.util.UITestCase;
34import com.jogamp.opengl.test.junit.util.QuitAdapter;
35import com.jogamp.opengl.test.junit.jogl.demos.es1.OlympicES1;
36import com.jogamp.opengl.util.Animator;
37import com.jogamp.opengl.util.AnimatorBase;
39import com.jogamp.opengl.GLCapabilities;
40import com.jogamp.opengl.GLProfile;
42import org.junit.Assert;
43import org.junit.BeforeClass;
44import org.junit.AfterClass;
46import org.junit.FixMethodOrder;
47import org.junit.runners.MethodSorters;
49@FixMethodOrder(MethodSorters.NAME_ASCENDING)
51 static int width, height;
52 static boolean forceES2 =
false;
53 static boolean forceFFPEmu =
false;
54 static boolean verboseFFPEmu =
false;
55 static int swapInterval = 1;
56 static boolean exclusiveContext =
false;
70 Assert.assertNotNull(glWindow);
71 glWindow.
setTitle(
"Olympic NEWT Test");
85 glWindow.
setSize(width, height);
88 animator.
add(glWindow);
92 Assert.assertTrue(animator.isAnimating());
97 while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.
getTotalFPSDuration()<duration) {
103 Assert.assertFalse(animator.isAnimating());
104 Assert.assertFalse(animator.
isStarted());
110 public void test00() throws InterruptedException {
115 static long duration = 500;
117 public static void main(
final String args[]) {
118 for(
int i=0; i<args.length; i++) {
119 if(args[i].equals(
"-time")) {
122 duration = Integer.parseInt(args[i]);
123 }
catch (
final Exception ex) { ex.printStackTrace(); }
124 }
else if(args[i].equals(
"-vsync")) {
127 }
else if(args[i].equals(
"-exclctx")) {
128 exclusiveContext =
true;
129 }
else if(args[i].equals(
"-es2")) {
131 }
else if(args[i].equals(
"-ffpemu")) {
133 }
else if(args[i].equals(
"-verbose")) {
134 verboseFFPEmu =
true;
137 System.err.println(
"forceES2 "+forceES2);
138 System.err.println(
"forceFFPEmu "+forceFFPEmu);
139 System.err.println(
"swapInterval "+swapInterval);
140 System.err.println(
"exclusiveContext "+exclusiveContext);
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
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 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 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)
static int atoi(final String str, final int def)
final long getTotalFPSDuration()
final synchronized Thread getThread()
final synchronized void add(final GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.
final synchronized Thread setExclusiveContext(final Thread t)
Dedicate all GLAutoDrawable's context to the given exclusive context thread.
final void setUpdateFPSFrames(final int frames, final PrintStream out)
synchronized boolean isStarted()
Indicates whether this animator has been started.
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.
Thread getExclusiveContextThread()