29package com.jogamp.opengl.test.junit.newt;
32import java.io.IOException;
34import com.jogamp.opengl.GLCapabilities;
35import com.jogamp.opengl.GLCapabilitiesImmutable;
36import com.jogamp.opengl.GLEventListener;
37import com.jogamp.opengl.GLProfile;
39import org.junit.Assert;
40import org.junit.BeforeClass;
41import org.junit.FixMethodOrder;
43import org.junit.runners.MethodSorters;
45import com.jogamp.newt.event.TraceWindowAdapter;
46import com.jogamp.newt.opengl.GLWindow;
47import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
48import com.jogamp.opengl.test.junit.util.MiscUtils;
49import com.jogamp.opengl.test.junit.util.UITestCase;
50import com.jogamp.opengl.util.Animator;
52@FixMethodOrder(MethodSorters.NAME_ASCENDING)
56 static int width, height;
57 static long durationPerTest = step*500;
67 Assert.assertNotNull(caps);
75 Assert.assertNotNull(glWindow);
84 glWindow.
setSize(width/step, height/step);
85 Assert.assertEquals(
false,glWindow.
isVisible());
87 Assert.assertEquals(
true,glWindow.
isVisible());
92 Assert.assertTrue(animator.
start());
95 for(
int i=0; i<durationPerTest; i+=50) {
97 final int j = (int) ( i / (durationPerTest/step) ) + 1;
99 final int w = width/step * j;
100 final int h = height/step * j;
101 System.err.println(
"resize: "+step_i+
" -> "+j+
" - "+w+
"x"+h);
111 Assert.assertEquals(
false, glWindow.
isVisible());
117 Assert.assertNotNull(caps);
124 Assert.assertNotNull(caps);
128 public static void main(
final String args[])
throws IOException {
129 for(
int i=0; i<args.length; i++) {
130 if(args[i].equals(
"-time")) {
131 durationPerTest =
MiscUtils.
atol(args[++i], durationPerTest);
135 org.junit.runner.JUnitCore.
main(tstname);
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final boolean isNativeValid()
final void setPosition(final int x, final int y)
Sets the location of the window's client area excluding insets (window decorations) in window units.
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 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 GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
static void main(final String args[])
void test02WindowUndecor()
static long atol(final String str, final long def)
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 setUpdateFPSFrames(int frames, PrintStream out)
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
Specifies an immutable set of OpenGL capabilities.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.