diff options
author | Sven Gothel <[email protected]> | 2011-04-28 22:09:31 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-04-28 22:09:31 +0200 |
commit | 39a8ca392d7302831f5689979c4ce89145b732af (patch) | |
tree | c338e8565169b871bbe8830c752bd19283eec9b3 /src/test | |
parent | 23bc6204b5e518e397e4ee4cdbe06f789970ee4f (diff) |
GLContext GLDebugMessages: Add synchronous status/dumpStack; Remove length in aliased glDebugMessageInsert.
- GLDebugMessages add synchronous status - defaults to true
- GLContext/GLDebugMessages add dumpStack() if jogl.debug.DebugGL is set
- Remove param length in aliased glDebugMessageInsert.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java | 49 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java | 6 |
2 files changed, 32 insertions, 23 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java index c6e78b219..1f8eebbc7 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java @@ -111,46 +111,33 @@ public class TestGLDebug00NEWT extends UITestCase { } - void test01GLDebug01EnableDisable(boolean enable, String dbgTstMsg, int dbgTstId) throws InterruptedException { + void test01GLDebug01EnableDisable(boolean enable) throws InterruptedException { GLProfile glp = GLProfile.getDefault(); WindowContext winctx = createWindow(glp, enable); - MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg, dbgTstId); - if(enable) { - winctx.context.addGLDebugListener(myGLDebugListener); - } String glDebugExt = winctx.context.getGLDebugMessageExtension(); System.err.println("glDebug extension: "+glDebugExt); System.err.println("glDebug enabled: "+winctx.context.isGLDebugMessageEnabled()); - System.err.println("glDebug listener: "+winctx.context.getGLDebugListenerSize()); + System.err.println("glDebug sync: "+winctx.context.isGLDebugSynchronous()); System.err.println("context version: "+winctx.context.getGLVersion()); Assert.assertEquals((null == glDebugExt) ? false : enable, winctx.context.isGLDebugMessageEnabled()); - Assert.assertEquals(enable?1:0, winctx.context.getGLDebugListenerSize()); - - if(winctx.context.isGLDebugMessageEnabled() && null != dbgTstMsg && 0 <= dbgTstId) { - winctx.context.glDebugMessageInsert(GL2GL3.GL_DEBUG_SOURCE_APPLICATION_ARB, - GL2GL3.GL_DEBUG_TYPE_OTHER_ARB, - dbgTstId, - GL2GL3.GL_DEBUG_SEVERITY_MEDIUM_ARB, -1, dbgTstMsg); - Assert.assertEquals(true, myGLDebugListener.received()); - } destroyWindow(winctx); } @Test - public void test01GLDebug01Disabled() throws InterruptedException { - test01GLDebug01EnableDisable(false, null, -1); + public void test01GLDebugDisabled() throws InterruptedException { + test01GLDebug01EnableDisable(false); } @Test - public void test01GLDebug01Enabled() throws InterruptedException { - test01GLDebug01EnableDisable(true, dbgTstMsg0, dbgTstId0); + public void test01GLDebugEnabled() throws InterruptedException { + test01GLDebug01EnableDisable(true); } @Test - public void test02GLDebug01Error() throws InterruptedException { + public void test02GLDebugError() throws InterruptedException { GLProfile glp = GLProfile.getDefault(); WindowContext winctx = createWindow(glp, true); @@ -172,6 +159,27 @@ public class TestGLDebug00NEWT extends UITestCase { destroyWindow(winctx); } + @Test + public void test03GLDebugInsert() throws InterruptedException { + GLProfile glp = GLProfile.getDefault(); + WindowContext winctx = createWindow(glp, true); + MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg0, dbgTstId0); + winctx.context.addGLDebugListener(myGLDebugListener); + + String glDebugExt = winctx.context.getGLDebugMessageExtension(); + Assert.assertEquals((null == glDebugExt) ? false : true, winctx.context.isGLDebugMessageEnabled()); + + if( winctx.context.isGLDebugMessageEnabled() ) { + winctx.context.glDebugMessageInsert(GL2GL3.GL_DEBUG_SOURCE_APPLICATION_ARB, + GL2GL3.GL_DEBUG_TYPE_OTHER_ARB, + dbgTstId0, + GL2GL3.GL_DEBUG_SEVERITY_MEDIUM_ARB, dbgTstMsg0); + Assert.assertEquals(true, myGLDebugListener.received()); + } + + destroyWindow(winctx); + } + public static void main(String args[]) throws IOException { String tstname = TestGLDebug00NEWT.class.getName(); @@ -214,6 +222,7 @@ public class TestGLDebug00NEWT extends UITestCase { recSeverity== event.getDbgSeverity() ) { received = true; } + Thread.dumpStack(); } } } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java index 05870ee0d..9a6548dd4 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java @@ -86,18 +86,17 @@ public class TestGLDebug01NEWT extends UITestCase { String glDebugExt = ctx.getGLDebugMessageExtension(); System.err.println("glDebug extension: "+glDebugExt); System.err.println("glDebug enabled: "+ctx.isGLDebugMessageEnabled()); - System.err.println("glDebug listener: "+ctx.getGLDebugListenerSize()); + System.err.println("glDebug sync: "+ ctx.isGLDebugSynchronous()); System.err.println("context version: "+ctx.getGLVersion()); Assert.assertEquals((null == glDebugExt) ? false : enable, ctx.isGLDebugMessageEnabled()); - Assert.assertEquals(enable?1:0, ctx.getGLDebugListenerSize()); if(ctx.isGLDebugMessageEnabled() && null != dbgTstMsg && 0 <= dbgTstId) { window.invoke(true, new GLRunnable() { public void run(GLAutoDrawable drawable) { drawable.getContext().glDebugMessageInsert(GL2GL3.GL_DEBUG_SOURCE_APPLICATION_ARB, GL2GL3.GL_DEBUG_TYPE_OTHER_ARB, dbgTstId, - GL2GL3.GL_DEBUG_SEVERITY_MEDIUM_ARB, -1, dbgTstMsg); + GL2GL3.GL_DEBUG_SEVERITY_MEDIUM_ARB, dbgTstMsg); } }); Assert.assertEquals(true, myGLDebugListener.received()); @@ -183,6 +182,7 @@ public class TestGLDebug01NEWT extends UITestCase { recSeverity== event.getDbgSeverity() ) { received = true; } + Thread.dumpStack(); } } } |