diff options
6 files changed, 30 insertions, 25 deletions
diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat index 80c7b5fee..4f227e14a 100644 --- a/make/scripts/tests-x64.bat +++ b/make/scripts/tests-x64.bat @@ -6,8 +6,8 @@ REM scripts\java-win64.bat com.jogamp.test.junit.jogl.acore.TestSharedContextLis REM scripts\java-win64.bat com.jogamp.test.junit.jogl.acore.TestSharedContextListNEWT -time 5000 REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT -scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT -time 30000 -REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsGLJPanelAWT -time 5000 +REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT -time 30000 +scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsGLJPanelAWT -time 5000 REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.awt.TestAWT03GLCanvasRecreate01 REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.glsl.TestTransformFeedbackVaryingsBug407NEWT diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index f96a1dc71..f6b46f4aa 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -74,7 +74,7 @@ function testawt() { #testnoawt com.jogamp.test.junit.jogl.glsl.TestGLSLSimple01NEWT $* #testnoawt com.jogamp.test.junit.newt.TestRemoteWindow01NEWT -time 1000000 #testnoawt com.jogamp.test.junit.newt.TestRemoteGLWindows01NEWT -time 1000000 -testawt com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT $* +#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT $* #testawt com.jogamp.test.junit.newt.TestDisplayLifecycle01NEWT #testawt com.jogamp.test.junit.newt.TestDisplayLifecycle02NEWT #testawt com.jogamp.test.junit.newt.parenting.TestParenting01NEWT @@ -97,7 +97,7 @@ testawt com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT $* #testawt com.jogamp.test.junit.jogl.awt.TestAWT03GLCanvasRecreate01 $* #testawt com.jogamp.test.junit.jogl.awt.TestAWT02WindowClosing #testawt com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsAWT -#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsGLJPanelAWT +testawt com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsGLJPanelAWT $* #testawt com.jogamp.test.junit.jogl.texture.TestTexture01AWT # diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java index 45b04fac1..5dae257ed 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java @@ -314,7 +314,7 @@ public class GLDrawableHelper { Runnable initAction) { if(null==context) { if (DEBUG) { - Exception e = new GLException(Thread.currentThread().getName()+"Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext"); + Exception e = new GLException(Thread.currentThread().getName()+" Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext"); e.printStackTrace(); } return; @@ -323,7 +323,7 @@ public class GLDrawableHelper { if(null==initAction) { // disposal case if(!context.isCreated()) { - throw new GLException("Dispose case (no init action given): Native context must be created: "+context); + throw new GLException(Thread.currentThread().getName()+" GLDrawableHelper " + this + ".invokeGL(): Dispose case (no init action given): Native context is not created: "+context); } } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java index 558cda106..5119f5360 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java @@ -104,16 +104,18 @@ public class GLPbufferImpl implements GLPbuffer { DisposeAction disposeAction = new DisposeAction(); public void destroy() { - if (null != context) { - try { - drawableHelper.invokeGL(pbufferDrawable, context, disposeAction, null); - } catch (GLException gle) { - gle.printStackTrace(); + if(pbufferDrawable.isRealized()) { + if (null != context && context.isCreated()) { + try { + drawableHelper.invokeGL(pbufferDrawable, context, disposeAction, null); + } catch (GLException gle) { + gle.printStackTrace(); + } + context.destroy(); + // drawableHelper.reset(); } - drawableHelper.reset(); - context.destroy(); + pbufferDrawable.destroy(); } - pbufferDrawable.destroy(); } public void setSize(int width, int height) { diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index c8bfe94d8..18ebcd129 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -255,6 +255,19 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { drawableHelper.invokeGL(disposeDrawable, disposeContext, disposeAction, null); } + if(!regenerate) { + AbstractGraphicsDevice adevice = disposeDrawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice(); + String adeviceMsg=null; + if(DEBUG) { + adeviceMsg = adevice.toString(); + } + // boolean closed = adevice.close(); + boolean closed = false; + if (DEBUG) { + System.err.println("GLJPanel.dispose(false): closed GraphicsDevice: " + adeviceMsg + ", result: " + closed); + } + } + backend.setContext(disposeContext); if(null==disposeContext) { isInitialized = false; @@ -656,16 +669,6 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { disposeDrawable.setRealized(true); disposeContext = (GLContextImpl) disposeDrawable.createContext(shareWith); disposeContext.setSynchronized(true); - } else { - AbstractGraphicsDevice adevice = disposeDrawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice(); - String adeviceMsg=null; - if(DEBUG) { - adeviceMsg = adevice.toString(); - } - boolean closed = adevice.close(); - if (DEBUG) { - System.err.println("GLJPanel.dispose(false): closed GraphicsDevice: " + adeviceMsg + ", result: " + closed); - } } } } diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java index 8b3273a0f..dfb70f61f 100644 --- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java +++ b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java @@ -106,7 +106,7 @@ public class TestGearsGLJPanelAWT extends UITestCase { } } ); } - @Ignore("not ready yet") @Test + @Test public void test01() throws AWTException, InterruptedException, InvocationTargetException { |