29package com.jogamp.opengl.test.junit.jogl.acore;
31import java.io.IOException;
33import com.jogamp.opengl.GLCapabilities;
34import com.jogamp.opengl.GLProfile;
36import org.junit.AfterClass;
37import org.junit.Assert;
39import org.junit.FixMethodOrder;
40import org.junit.runners.MethodSorters;
42import com.jogamp.common.os.Platform;
43import com.jogamp.junit.util.JunitTracer;
44import com.jogamp.nativewindow.AbstractGraphicsDevice;
45import com.jogamp.newt.opengl.GLWindow;
46import com.jogamp.opengl.JoglVersion;
47import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
48import com.jogamp.opengl.test.junit.util.UITestCase;
49import com.jogamp.opengl.util.Animator;
51@FixMethodOrder(MethodSorters.NAME_ASCENDING)
54 static long duration = 300;
56 protected void runTestGL(
final boolean onscreen)
throws InterruptedException {
62 Assert.assertNotNull(glWindow);
63 glWindow.
setTitle(
"Gears NEWT Test");
73 Assert.assertEquals(
true, animator.isAnimating());
74 Assert.assertEquals(
true, glWindow.
isVisible());
76 Assert.assertEquals(
true, glWindow.
isRealized());
89 JunitTracer.waitForKey(
"Exit");
93 protected void oneLife(
final boolean glInfo)
throws InterruptedException {
95 JunitTracer.waitForKey(
"Start One Life");
97 final long t0 = Platform.currentTimeMillis();
99 final long t1 = Platform.currentTimeMillis();
104 System.out.println(
"GLProfile.getDefault(): "+glp);
108 System.out.println(
"GLProfile.getDefaultDevice(): "+gd);
109 System.out.println(
"GLProfile.getDefault(gd): "+glp2);
110 Assert.assertEquals(glp, glp2);
116 final long t2 = Platform.currentTimeMillis();
120 final long t3 = Platform.currentTimeMillis();
122 final long t4 = Platform.currentTimeMillis();
123 System.err.println(
"Total: "+ (t4-t0) +
"ms");
124 System.err.println(
" GLProfile.initSingleton(): "+ (t1-t0) +
"ms");
125 System.err.println(
" Demo Code: "+ (t2-t1) +
"ms");
126 System.err.println(
" GLInfo: "+ (t3-t2) +
"ms");
127 System.err.println(
" GLProfile.shutdown(): "+ (t4-t3) +
"ms");
151 static boolean initOnly =
false;
152 static boolean waitForEach =
false;
153 static boolean waitForKey =
false;
155 public static void main(
final String args[])
throws IOException {
156 for(
int i=0; i<args.length; i++) {
157 if(args[i].equals(
"-wait")) {
159 }
else if(args[i].equals(
"-waitForEach")) {
162 }
else if(args[i].equals(
"-initOnly")) {
168 JunitTracer.waitForKey(
"Start");
172 org.junit.runner.JUnitCore.
main(tstname);
void setOnscreen(final boolean onscreen)
Sets whether the surface shall be on- or offscreen.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final boolean isNativeValid()
final void setTitle(final String title)
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 isVisible()
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
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.
void setPBuffer(final boolean enable)
Requesting offscreen pbuffer mode.
Specifies the the OpenGL profile.
static void shutdown()
Manual shutdown method, may be called after your last JOGL use within the running JVM.
static GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
static AbstractGraphicsDevice getDefaultDevice()
static GLProfile getGL2ES2(final AbstractGraphicsDevice device)
Returns the GL2ES2 profile implementation, hence compatible w/ GL2ES2.
static void initSingleton()
Static initialization of JOGL.
static StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, final boolean withCapabilitiesInfo)
void test02AnotherLifeWithGLInfo()
void oneLife(final boolean glInfo)
static void main(final String args[])
void runTestGL(final boolean onscreen)
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.
A interface describing a graphics device in a toolkit-independent manner.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
boolean isRealized()
Returns true if this drawable is realized, otherwise false.