Jogamp
Bug 741 HiDPI: Add ScalableSurface interface to get/set pixelScale w/ full OSX impl.
[jogl.git] / src / test / com / jogamp / opengl / test / junit / jogl / demos / es2 / newt / TestGearsES2NewtCanvasAWT.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.awt.BorderLayout;
32 import java.awt.Button;
33 import java.awt.Component;
34 import java.awt.Container;
35 import java.awt.Frame;
36 import java.awt.TextArea;
37 import java.awt.event.ComponentEvent;
38 import java.awt.event.ComponentListener;
39 import java.io.IOException;
40 import java.lang.reflect.InvocationTargetException;
41
42 import com.jogamp.common.os.Platform;
43 import com.jogamp.newt.Display;
44 import com.jogamp.newt.NewtFactory;
45 import com.jogamp.newt.Screen;
46 import com.jogamp.newt.Window;
47 import com.jogamp.newt.awt.NewtCanvasAWT;
48 import com.jogamp.newt.event.KeyEvent;
49 import com.jogamp.newt.event.WindowEvent;
50 import com.jogamp.newt.event.WindowAdapter;
51 import com.jogamp.newt.opengl.GLWindow;
52 import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
53 import com.jogamp.opengl.test.junit.util.MiscUtils;
54 import com.jogamp.opengl.test.junit.util.UITestCase;
55 import com.jogamp.opengl.test.junit.util.QuitAdapter;
56 import com.jogamp.opengl.util.Animator;
57 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
58 import com.jogamp.opengl.test.junit.newt.parenting.NewtAWTReparentingKeyAdapter;
59
60 import javax.media.nativewindow.ScalableSurface;
61 import javax.media.nativewindow.util.Dimension;
62 import javax.media.nativewindow.util.Point;
63 import javax.media.nativewindow.util.PointImmutable;
64 import javax.media.nativewindow.util.DimensionImmutable;
65 import javax.media.opengl.GLCapabilities;
66 import javax.media.opengl.GLCapabilitiesImmutable;
67 import javax.media.opengl.GLProfile;
68 import javax.swing.SwingUtilities;
69
70 import org.junit.Assert;
71 import org.junit.Assume;
72 import org.junit.BeforeClass;
73 import org.junit.AfterClass;
74 import org.junit.Test;
75 import org.junit.FixMethodOrder;
76 import org.junit.runners.MethodSorters;
77
78 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
79 public class TestGearsES2NewtCanvasAWT extends UITestCase {
80     public enum FrameLayout { None, TextOnBottom, BorderBottom, BorderBottom2, BorderCenter, BorderCenterSurrounded, DoubleBorderCenterSurrounded };
81     public enum ResizeBy { GLWindow, Component, Frame };
82
83     static int screenIdx = 0;
84     static PointImmutable wpos;
85     static DimensionImmutable wsize, rwsize = null;
86     static FrameLayout frameLayout = FrameLayout.None;
87     static ResizeBy resizeBy = ResizeBy.Component;
88     static int[] reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
89
90     static long duration = 500; // ms
91     static boolean opaque = true;
92     static int forceAlpha = -1;
93     static boolean fullscreen = false;
94     static boolean pmvUseBackingArray = true;
95     static int swapInterval = 1;
96     static boolean showFPS = false;
97     static int loops = 1;
98     static boolean loop_shutdown = false;
99     static boolean shallUseOffscreenFBOLayer = false;
100     static boolean forceES2 = false;
101     static boolean forceGL3 = false;
102     static boolean mainRun = false;
103     static boolean exclusiveContext = false;
104     static boolean useAnimator = true;
105
106     @BeforeClass
107     public static void initClass() {
108         if(null == wsize) {
109             wsize = new Dimension(640, 480);
110         }
111     }
112
113     @AfterClass
114     public static void releaseClass() {
115     }
116
117     static void setGLWindowSize(final Frame frame, final GLWindow glw, final DimensionImmutable new_sz) {
118         try {
119             glw.setSize(new_sz.getWidth(), new_sz.getHeight());
120             if( null != frame ) {
121                 javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
122                     public void run() {
123                         frame.pack();
124                     } } );
125             }
126         } catch( Throwable throwable ) {
127             throwable.printStackTrace();
128             Assume.assumeNoException( throwable );
129         }
130     }
131     static void setComponentSize(final Frame frame, final Component comp, final DimensionImmutable new_sz) {
132         try {
133             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
134                 public void run() {
135                     java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
136                     comp.setMinimumSize(d);
137                     comp.setPreferredSize(d);
138                     comp.setSize(d);
139                     if( null != frame ) {
140                         frame.pack();
141                     }
142                 } } );
143         } catch( Throwable throwable ) {
144             throwable.printStackTrace();
145             Assume.assumeNoException( throwable );
146         }
147     }
148     static void setFrameSize(final Frame frame, final boolean frameLayout, final DimensionImmutable new_sz) {
149         try {
150             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
151                 public void run() {
152                     java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
153                     frame.setSize(d);
154                     if( frameLayout ) {
155                         frame.validate();
156                     }
157                 } } );
158         } catch( Throwable throwable ) {
159             throwable.printStackTrace();
160             Assume.assumeNoException( throwable );
161         }
162     }
163
164     static void setSize(final ResizeBy resizeBy, final Frame frame, final boolean frameLayout, final Component comp, final GLWindow glw, final DimensionImmutable new_sz) {
165         switch( resizeBy ) {
166             case GLWindow:
167                 setGLWindowSize(frameLayout ? frame : null, glw, new_sz);
168                 break;
169             case Component:
170                 setComponentSize(frameLayout ? frame : null, comp, new_sz);
171                 break;
172             case Frame:
173                 setFrameSize(frame, frameLayout, new_sz);
174                 break;
175         }
176     }
177
178     private void setTitle(final Frame frame, final NewtCanvasAWT glc, final Window win, final GLCapabilitiesImmutable caps) {
179         final String capsA = caps.isBackgroundOpaque() ? "opaque" : "transl";
180         {
181             final java.awt.Rectangle b = glc.getBounds();
182             frame.setTitle("NewtCanvasAWT["+capsA+"], swapI "+swapInterval+", win: ["+b.x+"/"+b.y+" "+b.width+"x"+b.height+"], pix: "+glc.getNativeWindow().getSurfaceWidth()+"x"+glc.getNativeWindow().getSurfaceHeight());
183         }
184         win.setTitle("GLWindow["+capsA+"], swapI "+swapInterval+", win: "+win.getBounds()+", pix: "+win.getSurfaceWidth()+"x"+win.getSurfaceHeight());
185     }
186
187     // public enum ResizeBy { GLWindow, Component, Frame };
188     protected void runTestGL(final GLCapabilitiesImmutable caps, final ResizeBy resizeBy, final FrameLayout frameLayout) throws InterruptedException, InvocationTargetException {
189         System.err.println("requested: vsync "+swapInterval+", "+caps);
190         Display dpy = NewtFactory.createDisplay(null);
191         Screen screen = NewtFactory.createScreen(dpy, screenIdx);
192         final GLWindow glWindow = GLWindow.create(screen, caps);
193         Assert.assertNotNull(glWindow);
194         glWindow.setSurfaceScale(reqSurfacePixelScale);
195
196         final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
197         if ( shallUseOffscreenFBOLayer ) {
198             newtCanvasAWT.setShallUseOffscreenLayer(true);
199         }
200
201         final Frame frame = new Frame("AWT Parent Frame");
202
203         setSize(resizeBy, frame, false, newtCanvasAWT, glWindow, wsize);
204
205         switch( frameLayout) {
206             case None:
207                 frame.add(newtCanvasAWT);
208                 break;
209             case TextOnBottom:
210                 final TextArea ta = new TextArea(2, 20);
211                 ta.append("0123456789");
212                 ta.append(Platform.getNewline());
213                 ta.append("Some Text");
214                 ta.append(Platform.getNewline());
215                 frame.setLayout(new BorderLayout());
216                 frame.add(ta, BorderLayout.SOUTH);
217                 frame.add(newtCanvasAWT, BorderLayout.CENTER);
218                 break;
219             case BorderBottom:
220                 frame.setLayout(new BorderLayout());
221                 frame.add(newtCanvasAWT, BorderLayout.SOUTH);
222                 break;
223             case BorderBottom2:
224                 frame.setLayout(new BorderLayout());
225                 frame.add(newtCanvasAWT, BorderLayout.SOUTH);
226                 frame.add(new Button("North"), BorderLayout.NORTH);
227                 break;
228             case BorderCenter:
229                 frame.setLayout(new BorderLayout());
230                 frame.add(newtCanvasAWT, BorderLayout.CENTER);
231                 break;
232             case BorderCenterSurrounded:
233                 frame.setLayout(new BorderLayout());
234                 frame.add(new Button("NORTH"), BorderLayout.NORTH);
235                 frame.add(new Button("SOUTH"), BorderLayout.SOUTH);
236                 frame.add(new Button("EAST"), BorderLayout.EAST);
237                 frame.add(new Button("WEST"), BorderLayout.WEST);
238                 frame.add(newtCanvasAWT, BorderLayout.CENTER);
239                 break;
240             case DoubleBorderCenterSurrounded:
241                 Container c = new Container();
242                 c.setLayout(new BorderLayout());
243                 c.add(new Button("north"), BorderLayout.NORTH);
244                 c.add(new Button("south"), BorderLayout.SOUTH);
245                 c.add(new Button("east"), BorderLayout.EAST);
246                 c.add(new Button("west"), BorderLayout.WEST);
247                 c.add(newtCanvasAWT, BorderLayout.CENTER);
248
249                 frame.setLayout(new BorderLayout());
250                 frame.add(new Button("NORTH"), BorderLayout.NORTH);
251                 frame.add(new Button("SOUTH"), BorderLayout.SOUTH);
252                 frame.add(new Button("EAST"), BorderLayout.EAST);
253                 frame.add(new Button("WEST"), BorderLayout.WEST);
254                 frame.add(c, BorderLayout.CENTER);
255                 break;
256         }
257
258         final GearsES2 demo = new GearsES2(swapInterval);
259         demo.setPMVUseBackingArray(pmvUseBackingArray);
260         glWindow.addGLEventListener(demo);
261
262         frame.addComponentListener(new ComponentListener() {
263             @Override
264             public void componentResized(ComponentEvent e) {
265                 setTitle(frame, newtCanvasAWT, glWindow, caps);
266             }
267
268             @Override
269             public void componentMoved(ComponentEvent e) {
270                 setTitle(frame, newtCanvasAWT, glWindow, caps);
271             }
272
273             @Override
274             public void componentShown(ComponentEvent e) { }
275
276             @Override
277             public void componentHidden(ComponentEvent e) { }
278         });
279
280         final Animator animator = useAnimator ? new Animator() : null;
281         if( useAnimator ) {
282             animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
283             animator.setExclusiveContext(exclusiveContext);
284         }
285
286         final QuitAdapter quitAdapter = new QuitAdapter();
287         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
288         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
289         glWindow.addKeyListener(quitAdapter);
290         glWindow.addWindowListener(quitAdapter);
291
292         glWindow.addWindowListener(new WindowAdapter() {
293             public void windowResized(WindowEvent e) {
294                 System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
295             }
296             public void windowMoved(WindowEvent e) {
297                 System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
298             }
299         });
300
301         glWindow.addKeyListener(new NewtAWTReparentingKeyAdapter(frame, newtCanvasAWT, glWindow, quitAdapter));
302         glWindow.addKeyListener(new com.jogamp.newt.event.KeyAdapter() {
303             @Override
304             public void keyPressed(final KeyEvent e) {
305                 if( e.isAutoRepeat() ) {
306                     return;
307                 }
308                 if(e.getKeyChar()=='x') {
309                     final int[] hadSurfacePixelScale = glWindow.getSurfaceScale(new int[2]);
310                     final int[] reqSurfacePixelScale;
311                     if( hadSurfacePixelScale[0] == ScalableSurface.IDENTITY_PIXELSCALE ) {
312                         reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
313                     } else {
314                         reqSurfacePixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
315                     }
316                     System.err.println("[set PixelScale pre]: had "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" -> req "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]);
317                     glWindow.setSurfaceScale(reqSurfacePixelScale);
318                     final int[] hasSurfacePixelScale0 = glWindow.convertToPixelUnits(new int[] { 1, 1 });
319                     final int[] hasSurfacePixelScale1 = glWindow.getSurfaceScale(new int[2]);
320                     System.err.println("[set PixelScale post]: "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" (had) -> "+
321                                        reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
322                                        hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
323                     setTitle(frame, newtCanvasAWT, glWindow, caps);
324                     Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
325                 }
326             } } );
327
328         if( useAnimator ) {
329             animator.add(glWindow);
330             animator.start();
331             Assert.assertTrue(animator.isStarted());
332             Assert.assertTrue(animator.isAnimating());
333             Assert.assertEquals(exclusiveContext ? animator.getThread() : null, glWindow.getExclusiveContextThread());
334         }
335
336         SwingUtilities.invokeAndWait(new Runnable() {
337            public void run() {
338                if( ResizeBy.Frame == resizeBy ) {
339                    frame.validate();
340                } else {
341                    frame.pack();
342                }
343                frame.setVisible(true);
344            }
345         });
346         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
347         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));
348
349         if( useAnimator ) {
350             animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
351         }
352
353         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
354         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
355         System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
356
357         final int[] hasSurfacePixelScale0 = glWindow.convertToPixelUnits(new int[] { 1, 1 });
358         final int[] hasSurfacePixelScale1 = glWindow.getSurfaceScale(new int[2]);
359         System.err.println("HiDPI PixelScale: "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
360                            hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
361         setTitle(frame, newtCanvasAWT, glWindow, caps);
362         Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
363
364         if( null != rwsize ) {
365             Thread.sleep(500); // 500ms delay
366             setSize(resizeBy, frame, true, newtCanvasAWT, glWindow, rwsize);
367             System.err.println("window resize "+rwsize+" -> pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
368         }
369
370         final long t0 = System.currentTimeMillis();
371         long t1 = t0;
372         while(!quitAdapter.shouldQuit() && t1-t0<duration) {
373             Thread.sleep(100);
374             t1 = System.currentTimeMillis();
375         }
376
377         if( useAnimator ) {
378             Assert.assertEquals(exclusiveContext ? animator.getThread() : null, glWindow.getExclusiveContextThread());
379             animator.stop();
380             Assert.assertFalse(animator.isAnimating());
381             Assert.assertFalse(animator.isStarted());
382         }
383         Assert.assertEquals(null, glWindow.getExclusiveContextThread());
384         SwingUtilities.invokeAndWait(new Runnable() {
385            public void run() {
386                frame.dispose();
387            }
388         });
389         glWindow.destroy();
390         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, false));
391     }
392
393     @Test
394     public void test01GL2ES2() throws InterruptedException, InvocationTargetException {
395         for(int i=1; i<=loops; i++) {
396             System.err.println("Loop "+i+"/"+loops);
397             final GLProfile glp;
398             if(forceGL3) {
399                 glp = GLProfile.get(GLProfile.GL3);
400             } else if(forceES2) {
401                 glp = GLProfile.get(GLProfile.GLES2);
402             } else {
403                 glp = GLProfile.getGL2ES2();
404             }
405             final GLCapabilities caps = new GLCapabilities( glp );
406             caps.setBackgroundOpaque(opaque);
407             if(-1 < forceAlpha) {
408                 caps.setAlphaBits(forceAlpha);
409             }
410             runTestGL(caps, resizeBy, frameLayout);
411             if(loop_shutdown) {
412                 GLProfile.shutdown();
413             }
414         }
415     }
416
417     @Test
418     public void test02GL3() throws InterruptedException, InvocationTargetException {
419         if(mainRun) return;
420
421         if( !GLProfile.isAvailable(GLProfile.GL3) ) {
422             System.err.println("GL3 n/a");
423             return;
424         }
425         final GLProfile glp = GLProfile.get(GLProfile.GL3);
426         final GLCapabilities caps = new GLCapabilities( glp );
427         runTestGL(caps, resizeBy, frameLayout);
428     }
429
430     @Test
431     public void test99_PixelScale1_DefaultNorm() throws InterruptedException, InvocationTargetException {
432         if( mainRun ) return;
433
434         reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
435         reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
436
437         GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
438         runTestGL(caps, resizeBy, frameLayout);
439     }
440
441     public static void main(String args[]) throws IOException {
442         mainRun = true;
443
444         int x=0, y=0, w=640, h=480;
445         int rw=-1, rh=-1;
446         boolean usePos = false;
447
448         for(int i=0; i<args.length; i++) {
449             if(args[i].equals("-time")) {
450                 i++;
451                 duration = MiscUtils.atol(args[i], duration);
452             } else if(args[i].equals("-rwidth")) {
453                 i++;
454                 rw = MiscUtils.atoi(args[i], rw);
455             } else if(args[i].equals("-rheight")) {
456                 i++;
457                 rh = MiscUtils.atoi(args[i], rh);
458             } else if(args[i].equals("-layout")) {
459                 i++;
460                 frameLayout = FrameLayout.valueOf(args[i]);
461             } else if(args[i].equals("-resizeBy")) {
462                 i++;
463                 resizeBy = ResizeBy.valueOf(args[i]);
464             } else if(args[i].equals("-translucent")) {
465                 opaque = false;
466             } else if(args[i].equals("-forceAlpha")) {
467                 i++;
468                 forceAlpha = MiscUtils.atoi(args[i], 0);
469             } else if(args[i].equals("-fullscreen")) {
470                 fullscreen = true;
471             } else if(args[i].equals("-pmvDirect")) {
472                 pmvUseBackingArray = false;
473             } else if(args[i].equals("-vsync")) {
474                 i++;
475                 swapInterval = MiscUtils.atoi(args[i], swapInterval);
476             } else if(args[i].equals("-layeredFBO")) {
477                 shallUseOffscreenFBOLayer = true;
478             } else if(args[i].equals("-exclctx")) {
479                 exclusiveContext = true;
480             } else if(args[i].equals("-noanim")) {
481                 useAnimator  = false;
482             } else if(args[i].equals("-es2")) {
483                 forceES2 = true;
484             } else if(args[i].equals("-gl3")) {
485                 forceGL3 = true;
486             } else if(args[i].equals("-showFPS")) {
487                 showFPS = true;
488             } else if(args[i].equals("-width")) {
489                 i++;
490                 w = MiscUtils.atoi(args[i], w);
491             } else if(args[i].equals("-height")) {
492                 i++;
493                 h = MiscUtils.atoi(args[i], h);
494             } else if(args[i].equals("-x")) {
495                 i++;
496                 x = MiscUtils.atoi(args[i], x);
497                 usePos = true;
498             } else if(args[i].equals("-y")) {
499                 i++;
500                 y = MiscUtils.atoi(args[i], y);
501                 usePos = true;
502             } else if(args[i].equals("-pixelScale")) {
503                 i++;
504                 final int pS = MiscUtils.atoi(args[i], reqSurfacePixelScale[0]);
505                 reqSurfacePixelScale[0] = pS;
506                 reqSurfacePixelScale[1] = pS;
507             } else if(args[i].equals("-screen")) {
508                 i++;
509                 screenIdx = MiscUtils.atoi(args[i], 0);
510             } else if(args[i].equals("-loops")) {
511                 i++;
512                 loops = MiscUtils.atoi(args[i], 1);
513             } else if(args[i].equals("-loop-shutdown")) {
514                 loop_shutdown = true;
515             }
516         }
517         wsize = new Dimension(w, h);
518         if( 0 < rw && 0 < rh ) {
519             rwsize = new Dimension(rw, rh);
520         }
521
522         if(usePos) {
523             wpos = new Point(x, y);
524         }
525
526         System.err.println("frameLayout "+frameLayout);
527         System.err.println("resizeBy "+resizeBy);
528         System.err.println("position "+wpos);
529         System.err.println("size "+wsize);
530         System.err.println("resize "+rwsize);
531         System.err.println("screen "+screenIdx);
532         System.err.println("translucent "+(!opaque));
533         System.err.println("forceAlpha "+forceAlpha);
534         System.err.println("fullscreen "+fullscreen);
535         System.err.println("pmvDirect "+(!pmvUseBackingArray));
536         System.err.println("loops "+loops);
537         System.err.println("loop shutdown "+loop_shutdown);
538         System.err.println("shallUseOffscreenFBOLayer     "+shallUseOffscreenFBOLayer);
539         System.err.println("forceES2 "+forceES2);
540         System.err.println("forceGL3 "+forceGL3);
541         System.err.println("swapInterval "+swapInterval);
542         System.err.println("exclusiveContext "+exclusiveContext);
543         System.err.println("useAnimator "+useAnimator);
544
545         org.junit.runner.JUnitCore.main(TestGearsES2NewtCanvasAWT.class.getName());
546     }
547 }
http://JogAmp.org git info: FAQ, tutorial and man pages.