Jogamp
Bug 1223: Add '-traceMouse' commandline argument to check whether mouse events are...
[jogl.git] / src / test / com / jogamp / opengl / test / junit / jogl / demos / es2 / newt / TestGearsES2NEWT.java
1 /**
2  * Copyright 2011 JogAmp Community. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification, are
5  * permitted provided that the following conditions are met:
6  *
7  *    1. Redistributions of source code must retain the above copyright notice, this list of
8  *       conditions and the following disclaimer.
9  *
10  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
11  *       of conditions and the following disclaimer in the documentation and/or other materials
12  *       provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  * The views and conclusions contained in the software and documentation are those of the
25  * authors and should not be interpreted as representing official policies, either expressed
26  * or implied, of JogAmp Community.
27  */
28
29 package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
30
31 import java.io.IOException;
32 import java.lang.reflect.InvocationTargetException;
33
34 import com.jogamp.junit.util.JunitTracer;
35 import com.jogamp.newt.Display;
36 import com.jogamp.newt.NewtFactory;
37 import com.jogamp.newt.Screen;
38 import com.jogamp.newt.Window;
39 import com.jogamp.newt.event.WindowEvent;
40 import com.jogamp.newt.event.KeyAdapter;
41 import com.jogamp.newt.event.KeyEvent;
42 import com.jogamp.newt.event.TraceMouseAdapter;
43 import com.jogamp.newt.event.WindowAdapter;
44 import com.jogamp.newt.opengl.GLWindow;
45 import com.jogamp.newt.opengl.util.NEWTDemoListener;
46 import com.jogamp.newt.util.EDTUtil;
47 import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
48 import com.jogamp.opengl.test.junit.util.MiscUtils;
49 import com.jogamp.opengl.test.junit.util.UITestCase;
50 import com.jogamp.opengl.util.Animator;
51 import com.jogamp.opengl.util.AnimatorBase;
52 import com.jogamp.opengl.test.junit.jogl.demos.GLClearOnInitReshape;
53 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
54 import com.jogamp.opengl.test.junit.jogl.demos.es2.LineSquareXDemoES2;
55 import com.jogamp.nativewindow.NativeWindowFactory;
56 import com.jogamp.nativewindow.ScalableSurface;
57 import com.jogamp.nativewindow.util.Dimension;
58 import com.jogamp.nativewindow.util.Point;
59 import com.jogamp.nativewindow.util.PointImmutable;
60 import com.jogamp.nativewindow.util.DimensionImmutable;
61 import com.jogamp.opengl.GLAnimatorControl;
62 import com.jogamp.opengl.GLAutoDrawable;
63 import com.jogamp.opengl.GLCapabilities;
64 import com.jogamp.opengl.GLCapabilitiesImmutable;
65 import com.jogamp.opengl.GLEventListener;
66 import com.jogamp.opengl.GLProfile;
67
68 import jogamp.newt.DefaultEDTUtil;
69
70 import org.junit.Assert;
71 import org.junit.BeforeClass;
72 import org.junit.AfterClass;
73 import org.junit.Test;
74 import org.junit.FixMethodOrder;
75 import org.junit.runners.MethodSorters;
76
77 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
78 public class TestGearsES2NEWT extends UITestCase {
79     static int screenIdx = 0;
80     static PointImmutable wpos;
81     static DimensionImmutable wsize, rwsize=null;
82     static float[] reqSurfacePixelScale = new float[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
83
84     static long duration = 500; // ms
85     static boolean opaque = true;
86     static int forceAlpha = -1;
87     static boolean undecorated = false;
88     static boolean alwaysOnTop = false;
89     static boolean alwaysOnBottom = false;
90     static boolean resizable = true;
91     static boolean sticky = false;
92     static boolean max_vert= false;
93     static boolean max_horz= false;
94     static boolean fullscreen = false;
95     static int swapInterval = 1;
96     static boolean waitForKey = false;
97     static boolean mouseVisible = true;
98     static boolean mouseConfined = false;
99     static boolean setPointerIcon = false;
100     static boolean showFPS = false;
101     static int loops = 1;
102     static boolean loop_shutdown = false;
103     static boolean forceES2 = false;
104     static boolean forceES3 = false;
105     static boolean forceGL3 = false;
106     static boolean forceGL2 = false;
107     static int demoType = 1;
108     static boolean traceMouse = false;
109     static boolean manualTest = false;
110     static boolean exclusiveContext = false;
111     static boolean useAnimator = true;
112     static boolean useMappedBuffers = false;
113     static enum SysExit { none, testExit, testError, testEDTError, displayExit, displayError, displayEDTError };
114     static SysExit sysExit = SysExit.none;
115
116     @BeforeClass
117     public static void initClass() {
118         if(null == wsize) {
119             wsize = new Dimension(640, 480);
120         }
121     }
122
123     @AfterClass
124     public static void releaseClass() {
125     }
126
127     protected void runTestGL(final GLCapabilitiesImmutable caps, final boolean undecorated) throws InterruptedException {
128         System.err.println("requested: vsync "+swapInterval+", "+caps);
129         final Display dpy = NewtFactory.createDisplay(null);
130         final Screen screen = NewtFactory.createScreen(dpy, screenIdx);
131         final GLWindow glWindow = GLWindow.create(screen, caps);
132         Assert.assertNotNull(glWindow);
133         glWindow.setSurfaceScale(reqSurfacePixelScale);
134         final float[] valReqSurfacePixelScale = glWindow.getRequestedSurfaceScale(new float[2]);
135         glWindow.setSize(wsize.getWidth(), wsize.getHeight());
136         if(null != wpos) {
137             glWindow.setPosition(wpos.getX(), wpos.getY());
138         }
139         glWindow.setUndecorated(undecorated);
140         glWindow.setAlwaysOnTop(alwaysOnTop);
141         glWindow.setAlwaysOnBottom(alwaysOnBottom);
142         glWindow.setResizable(resizable);
143         glWindow.setSticky(sticky);
144         glWindow.setMaximized(max_horz, max_vert);
145         glWindow.setFullscreen(fullscreen);
146         glWindow.setPointerVisible(mouseVisible);
147         glWindow.confinePointer(mouseConfined);
148
149         final GLEventListener demo;
150         if( 2 == demoType ) {
151             final LineSquareXDemoES2 demo2 = new LineSquareXDemoES2(false);
152             demo = demo2;
153         } else if( 1 == demoType ) {
154             final GearsES2 gearsES2 = new GearsES2(swapInterval);
155             gearsES2.setUseMappedBuffers(useMappedBuffers);
156             gearsES2.setValidateBuffers(true);
157             demo = gearsES2;
158         } else if( 0 == demoType ) {
159             demo = new GLClearOnInitReshape();
160         } else {
161             demo = null;
162         }
163         if( null != demo ) {
164             glWindow.addGLEventListener(demo);
165         }
166
167         final SnapshotGLEventListener snap = new SnapshotGLEventListener();
168         glWindow.addGLEventListener(snap);
169         if(waitForKey) {
170             glWindow.addGLEventListener(new GLEventListener() {
171                 public void init(final GLAutoDrawable drawable) { }
172                 public void dispose(final GLAutoDrawable drawable) { }
173                 public void display(final GLAutoDrawable drawable) {
174                     final GLAnimatorControl  actrl = drawable.getAnimator();
175                     if(waitForKey && actrl.getTotalFPSFrames() == 60*3) {
176                         JunitTracer.waitForKey("3s mark");
177                         actrl.resetFPSCounter();
178                         waitForKey = false;
179                     }
180                 }
181                 public void reshape(final GLAutoDrawable drawable, final int x, final int y,
182                         final int width, final int height) { }
183             });
184         }
185
186         final Animator animator = useAnimator ? new Animator() : null;
187         if( useAnimator ) {
188             animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
189             animator.setExclusiveContext(exclusiveContext);
190         }
191
192         glWindow.addWindowListener(new WindowAdapter() {
193             public void windowResized(final WindowEvent e) {
194                 System.err.println("window resized: "+glWindow.getBounds()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
195                 NEWTDemoListener.setTitle(glWindow);
196             }
197             public void windowMoved(final WindowEvent e) {
198                 System.err.println("window moved:   "+glWindow.getBounds()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
199                 NEWTDemoListener.setTitle(glWindow);
200             }
201         });
202
203         final GLWindow[] glWindow2 = { null };
204
205         final NEWTDemoListener newtDemoListener = new NEWTDemoListener(glWindow);
206         newtDemoListener.quitAdapterEnable(true);
207         glWindow.addKeyListener(newtDemoListener);
208         if( traceMouse ) {
209             glWindow.addMouseListener(new TraceMouseAdapter());
210         }
211         glWindow.addMouseListener(newtDemoListener);
212         glWindow.addWindowListener(newtDemoListener);
213         glWindow.addKeyListener(new KeyAdapter() {
214             @Override
215             public void keyPressed(final KeyEvent e) {
216                 if( e.isAutoRepeat() ) {
217                     return;
218                 }
219                 if(e.getKeyChar()=='n') {
220                     if( null != glWindow2[0] && glWindow2[0].isNativeValid() ) {
221                         glWindow2[0].destroy();
222                         glWindow2[0] = null;
223                     } else {
224                         glWindow2[0] = GLWindow.create(screen, caps);
225                         glWindow2[0].setTitle("GLWindow2");
226                         glWindow2[0].setPosition(glWindow.getX()+glWindow.getWidth()+64, glWindow.getY());
227                         glWindow2[0].setSize(glWindow.getWidth(), glWindow.getHeight());
228                         glWindow2[0].addGLEventListener(new LineSquareXDemoES2(false));
229                         final Animator animator2 = useAnimator ? new Animator(glWindow2[0]) : null;
230                         if( null != animator2 ) {
231                             animator2.start();
232                         }
233                         glWindow2[0].setVisible(true);
234                     }
235                 }
236             } } );
237
238         if( useAnimator ) {
239             animator.add(glWindow);
240             animator.start();
241             Assert.assertTrue(animator.isStarted());
242             Assert.assertTrue(animator.isAnimating());
243             Assert.assertEquals(exclusiveContext ? animator.getThread() : null, glWindow.getExclusiveContextThread());
244         }
245
246         if( SysExit.displayError == sysExit || SysExit.displayExit == sysExit || SysExit.displayEDTError == sysExit ) {
247             glWindow.addGLEventListener(new GLEventListener() {
248                 @Override
249                 public void init(final GLAutoDrawable drawable) {}
250                 @Override
251                 public void dispose(final GLAutoDrawable drawable) { }
252                 @Override
253                 public void display(final GLAutoDrawable drawable) {
254                     final GLAnimatorControl anim = drawable.getAnimator();
255                     if( null != anim && anim.isAnimating() ) {
256                         final long ms = anim.getTotalFPSDuration();
257                         if( ms >= duration/2 || ms >= 3000 ) { // max 3s wait until provoking error
258                             if( SysExit.displayError == sysExit ) {
259                                 throw new Error("test error send from GLEventListener.display - "+Thread.currentThread());
260                             } else if ( SysExit.displayExit == sysExit ) {
261                                 System.err.println("exit(0) send from GLEventListener");
262                                 System.exit(0);
263                             } else if ( SysExit.displayEDTError == sysExit ) {
264                                 final Object upstream = drawable.getUpstreamWidget();
265                                 System.err.println("EDT invokeAndWaitError: upstream type "+upstream.getClass().getName());
266                                 if( upstream instanceof Window ) {
267                                     final EDTUtil edt = ((Window)upstream).getScreen().getDisplay().getEDTUtil();
268                                     System.err.println("EDT invokeAndWaitError: edt type "+edt.getClass().getName());
269                                     if( edt instanceof DefaultEDTUtil ) {
270                                         newtDemoListener.doQuit();
271                                         ((DefaultEDTUtil)edt).invokeAndWaitError(new Runnable() {
272                                             public void run() {
273                                                 throw new RuntimeException("XXX Should never ever be seen! - "+Thread.currentThread());
274                                             }
275                                         });
276                                     }
277                                 }
278                             }
279                         }
280                     } else {
281                         System.exit(0);
282                     }
283                 }
284                 @Override
285                 public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
286             });
287         }
288
289         glWindow.setVisible(true);
290         if( useAnimator ) {
291             animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
292         }
293
294         System.err.println("Window Current State   : "+glWindow.getStateMaskString());
295         System.err.println("Window Supported States: "+glWindow.getSupportedStateMaskString());
296         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
297         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
298         System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
299
300         final float[] hasSurfacePixelScale1 = glWindow.getCurrentSurfaceScale(new float[2]);
301         System.err.println("HiDPI PixelScale: "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
302                            valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
303                            hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
304         NEWTDemoListener.setTitle(glWindow);
305
306         snap.setMakeSnapshot();
307
308         if( null != rwsize ) {
309             Thread.sleep(500); // 500ms delay
310             glWindow.setSize(rwsize.getWidth(), rwsize.getHeight());
311             System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
312         }
313
314         snap.setMakeSnapshot();
315
316         final long t0 = System.currentTimeMillis();
317         long t1 = t0;
318         while(!newtDemoListener.shouldQuit() && t1-t0<duration) {
319             Thread.sleep(100);
320             t1 = System.currentTimeMillis();
321             if( SysExit.testError == sysExit || SysExit.testExit == sysExit || SysExit.testEDTError == sysExit) {
322                 final long ms = t1-t0;
323                 if( ms >= duration/2 || ms >= 3000 ) { // max 3s wait until provoking error
324                     if( SysExit.testError == sysExit ) {
325                         throw new Error("test error send from test thread");
326                     } else if ( SysExit.testExit == sysExit ) {
327                         System.err.println("exit(0) send from test thread");
328                         System.exit(0);
329                     } else if ( SysExit.testEDTError == sysExit ) {
330                         final EDTUtil edt = glWindow.getScreen().getDisplay().getEDTUtil();
331                         System.err.println("EDT invokeAndWaitError: edt type "+edt.getClass().getName());
332                         if( edt instanceof DefaultEDTUtil ) {
333                             newtDemoListener.doQuit();
334                             ((DefaultEDTUtil)edt).invokeAndWaitError(new Runnable() {
335                                 public void run() {
336                                     throw new RuntimeException("XXX Should never ever be seen!");
337                                 }
338                             });
339                         }
340                     }
341                 }
342             }
343         }
344
345         if( useAnimator ) {
346             Assert.assertEquals(exclusiveContext ? animator.getThread() : null, glWindow.getExclusiveContextThread());
347             animator.stop();
348             Assert.assertFalse(animator.isAnimating());
349             Assert.assertFalse(animator.isStarted());
350         }
351         Assert.assertEquals(null, glWindow.getExclusiveContextThread());
352         glWindow.destroy();
353         if( null != glWindow2[0] && glWindow2[0].isNativeValid() ) {
354             glWindow2[0].destroy();
355             glWindow2[0] = null;
356         }
357         if( NativeWindowFactory.isAWTAvailable() ) {
358             Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, false));
359         }
360     }
361
362     @Test
363     public void test01_GL2ES2() throws InterruptedException {
364         for(int i=1; i<=loops; i++) {
365             System.err.println("Loop "+i+"/"+loops);
366             final GLProfile glp;
367             if(forceGL3) {
368                 glp = GLProfile.get(GLProfile.GL3);
369             } else if(forceES3) {
370                 glp = GLProfile.get(GLProfile.GLES3);
371             } else if(forceES2) {
372                 glp = GLProfile.get(GLProfile.GLES2);
373             } else if(forceGL2) {
374                 glp = GLProfile.get(GLProfile.GL2);
375             } else {
376                 glp = GLProfile.getGL2ES2();
377             }
378             final GLCapabilities caps = new GLCapabilities( glp );
379             caps.setBackgroundOpaque(opaque);
380             if(-1 < forceAlpha) {
381                 caps.setAlphaBits(forceAlpha);
382             }
383             runTestGL(caps, undecorated);
384             if(loop_shutdown) {
385                 GLProfile.shutdown();
386             }
387         }
388     }
389
390     @Test
391     public void test02_GLES2() throws InterruptedException {
392         if(manualTest) return;
393
394         if( !GLProfile.isAvailable(GLProfile.GLES2) ) {
395             System.err.println("GLES2 n/a");
396             return;
397         }
398         final GLProfile glp = GLProfile.get(GLProfile.GLES2);
399         final GLCapabilities caps = new GLCapabilities( glp );
400         runTestGL(caps, undecorated);
401     }
402
403     @Test
404     public void test03_GL3() throws InterruptedException {
405         if(manualTest) return;
406
407         if( !GLProfile.isAvailable(GLProfile.GL3) ) {
408             System.err.println("GL3 n/a");
409             return;
410         }
411         final GLProfile glp = GLProfile.get(GLProfile.GL3);
412         final GLCapabilities caps = new GLCapabilities( glp );
413         runTestGL(caps, undecorated);
414     }
415
416     @Test
417     public void test99_PixelScale1_DefaultNorm() throws InterruptedException, InvocationTargetException {
418         if( manualTest ) return;
419
420         reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
421         reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
422
423         final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
424         runTestGL(caps, undecorated);
425     }
426
427     public static void main(final String args[]) throws IOException {
428         int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
429         boolean usePos = false;
430
431         for(int i=0; i<args.length; i++) {
432             if(args[i].equals("-time")) {
433                 i++;
434                 duration = MiscUtils.atol(args[i], duration);
435             } else if(args[i].equals("-translucent")) {
436                 opaque = false;
437             } else if(args[i].equals("-forceAlpha")) {
438                 i++;
439                 forceAlpha = MiscUtils.atoi(args[i], 0);
440             } else if(args[i].equals("-undecorated")) {
441                 undecorated = true;
442             } else if(args[i].equals("-atop")) {
443                 alwaysOnTop = true;
444             } else if(args[i].equals("-abottom")) {
445                 alwaysOnBottom = true;
446             } else if(args[i].equals("-noresize")) {
447                 resizable = false;
448             } else if(args[i].equals("-sticky")) {
449                 sticky = true;
450             } else if(args[i].equals("-maxv")) {
451                 max_vert = true;
452             } else if(args[i].equals("-maxh")) {
453                 max_horz = true;
454             } else if(args[i].equals("-fullscreen")) {
455                 fullscreen = true;
456             } else if(args[i].equals("-vsync")) {
457                 i++;
458                 swapInterval = MiscUtils.atoi(args[i], swapInterval);
459             } else if(args[i].equals("-exclctx")) {
460                 exclusiveContext = true;
461             } else if(args[i].equals("-noanim")) {
462                 useAnimator  = false;
463             } else if(args[i].equals("-es2")) {
464                 forceES2 = true;
465             } else if(args[i].equals("-es3")) {
466                 forceES3 = true;
467             } else if(args[i].equals("-gl3")) {
468                 forceGL3 = true;
469             } else if(args[i].equals("-gl2")) {
470                 forceGL2 = true;
471             } else if(args[i].equals("-mappedBuffers")) {
472                 useMappedBuffers = true;
473             } else if(args[i].equals("-wait")) {
474                 waitForKey = true;
475             } else if(args[i].equals("-mouseInvisible")) {
476                 mouseVisible = false;
477             } else if(args[i].equals("-mouseConfine")) {
478                 mouseConfined = true;
479             } else if(args[i].equals("-pointerIcon")) {
480                 setPointerIcon = true;
481             } else if(args[i].equals("-showFPS")) {
482                 showFPS = true;
483             } else if(args[i].equals("-width")) {
484                 i++;
485                 w = MiscUtils.atoi(args[i], w);
486             } else if(args[i].equals("-height")) {
487                 i++;
488                 h = MiscUtils.atoi(args[i], h);
489             } else if(args[i].equals("-x")) {
490                 i++;
491                 x = MiscUtils.atoi(args[i], x);
492                 usePos = true;
493             } else if(args[i].equals("-y")) {
494                 i++;
495                 y = MiscUtils.atoi(args[i], y);
496                 usePos = true;
497             } else if(args[i].equals("-pixelScale")) {
498                 i++;
499                 final float pS = MiscUtils.atof(args[i], reqSurfacePixelScale[0]);
500                 reqSurfacePixelScale[0] = pS;
501                 reqSurfacePixelScale[1] = pS;
502             } else if(args[i].equals("-rwidth")) {
503                 i++;
504                 rw = MiscUtils.atoi(args[i], rw);
505             } else if(args[i].equals("-rheight")) {
506                 i++;
507                 rh = MiscUtils.atoi(args[i], rh);
508             } else if(args[i].equals("-screen")) {
509                 i++;
510                 screenIdx = MiscUtils.atoi(args[i], 0);
511             } else if(args[i].equals("-loops")) {
512                 i++;
513                 loops = MiscUtils.atoi(args[i], 1);
514             } else if(args[i].equals("-loop-shutdown")) {
515                 loop_shutdown = true;
516             } else if(args[i].equals("-sysExit")) {
517                 i++;
518                 sysExit = SysExit.valueOf(args[i]);
519             } else if(args[i].equals("-manual")) {
520                 manualTest = true;
521             } else if(args[i].equals("-demo")) {
522                 i++;
523                 demoType = MiscUtils.atoi(args[i], 0);
524             } else if(args[i].equals("-traceMouse")) {
525                 traceMouse = true;
526             }
527         }
528         wsize = new Dimension(w, h);
529         if( 0 < rw && 0 < rh ) {
530             rwsize = new Dimension(rw, rh);
531         }
532
533         if(usePos) {
534             wpos = new Point(x, y);
535         }
536         System.err.println("position "+wpos);
537         System.err.println("size "+wsize);
538         System.err.println("resize "+rwsize);
539         System.err.println("screen "+screenIdx);
540         System.err.println("translucent "+(!opaque));
541         System.err.println("forceAlpha "+forceAlpha);
542         System.err.println("undecorated "+undecorated);
543         System.err.println("atop "+alwaysOnTop);
544         System.err.println("abottom "+alwaysOnBottom);
545         System.err.println("resizable "+resizable);
546         System.err.println("sticky "+sticky);
547         System.err.println("max_vert "+max_vert);
548         System.err.println("max_horz "+max_horz);
549         System.err.println("fullscreen "+fullscreen);
550         System.err.println("mouseVisible "+mouseVisible);
551         System.err.println("mouseConfined "+mouseConfined);
552         System.err.println("pointerIcon "+setPointerIcon);
553         System.err.println("loops "+loops);
554         System.err.println("loop shutdown "+loop_shutdown);
555         System.err.println("forceES2 "+forceES2);
556         System.err.println("forceES3 "+forceES3);
557         System.err.println("forceGL3 "+forceGL3);
558         System.err.println("forceGL2 "+forceGL2);
559         System.err.println("swapInterval "+swapInterval);
560         System.err.println("exclusiveContext "+exclusiveContext);
561         System.err.println("useAnimator "+useAnimator);
562         System.err.println("sysExitWithin "+sysExit);
563         System.err.println("mappedBuffers "+useMappedBuffers);
564         System.err.println("demoType "+demoType);
565         System.err.println("traceMouse "+traceMouse);
566
567         if(waitForKey) {
568             JunitTracer.waitForKey("Start");
569         }
570         org.junit.runner.JUnitCore.main(TestGearsES2NEWT.class.getName());
571     }
572 }
http://JogAmp.org git info: FAQ, tutorial and man pages.