diff options
Diffstat (limited to 'src/junit/com/jogamp/test')
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java | 25 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java | 10 |
2 files changed, 29 insertions, 6 deletions
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java index a8caafb30..5800af9af 100755 --- a/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java @@ -65,8 +65,26 @@ public class TestOffscreen01NEWT { } @Test - public void test1() { - if(false) { + public void test01OffscreenWindow() { + if(true) { + GLWindow windowOffscreen = WindowUtilNEWT.createGLWindow(caps, width, height, false, true, false); + GLEventListener demo = new RedSquare(); + GLWindow windowOnScreen = null; + WindowListener wl=null; + MouseListener ml=null; + SurfaceUpdatedListener ul=null; + + WindowUtilNEWT.run(windowOffscreen, null, windowOnScreen, wl, ml, ul, 2, true /*debug*/); + try { + Thread.sleep(1000); // 1000 ms + } catch (Exception e) {} + WindowUtilNEWT.shutdown(windowOffscreen, windowOnScreen); + } + } + + @Test + public void test02OffscreenSnapshotWithDemo() { + if(true) { GLWindow windowOffscreen = WindowUtilNEWT.createGLWindow(caps, width, height, false, true, false); GLEventListener demo = new RedSquare(); GLWindow windowOnScreen = null; @@ -75,6 +93,9 @@ public class TestOffscreen01NEWT { SurfaceUpdatedListener ul=null; WindowUtilNEWT.run(windowOffscreen, demo, windowOnScreen, wl, ml, ul, 2, true /*debug*/); + try { + Thread.sleep(1000); // 1000 ms + } catch (Exception e) {} WindowUtilNEWT.shutdown(windowOffscreen, windowOnScreen); } } diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java index 31ee7b552..b9541dbaf 100755 --- a/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java @@ -79,14 +79,16 @@ public class WindowUtilNEWT { GLWindow windowOnScreen, WindowListener wl, MouseListener ml, SurfaceUpdatedListener ul, int frames, boolean debug) { try { - if(debug) { + if(debug && null!=demo) { MiscUtils.setField(demo, "glDebug", new Boolean(true)); MiscUtils.setField(demo, "glTrace", new Boolean(true)); } - if(!MiscUtils.setField(demo, "window", windowOffscreen)) { - MiscUtils.setField(demo, "glWindow", windowOffscreen); + if(null!=demo) { + if(!MiscUtils.setField(demo, "window", windowOffscreen)) { + MiscUtils.setField(demo, "glWindow", windowOffscreen); + } + windowOffscreen.addGLEventListener(demo); } - windowOffscreen.addGLEventListener(demo); if ( null != windowOnScreen ) { if(null!=wl) { |