diff options
author | Sven Gothel <[email protected]> | 2013-04-10 02:49:14 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-04-10 02:49:14 +0200 |
commit | eff09c3545f32f1f481198d57de71a5bf564e797 (patch) | |
tree | 704faeb913d7d396ac10ee3dafa6a4aef7b9f595 /src/jogl/classes/jogamp/opengl/GLDrawableHelper.java | |
parent | 2b3bb9426385d97375c3312f5c0f4e2a827b1fbb (diff) |
Debug Messages: Unify getThreadName() usage and 'Catched Exception' messages
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLDrawableHelper.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLDrawableHelper.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java index 9c1cd478b..177c465da 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java @@ -887,7 +887,7 @@ public class GLDrawableHelper { final Runnable initAction) { if(null==context) { if (DEBUG) { - Exception e = new GLException(Thread.currentThread().getName()+" Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext"); + Exception e = new GLException(getThreadName()+" Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext"); e.printStackTrace(); } return; @@ -935,7 +935,7 @@ public class GLDrawableHelper { res = context.makeCurrent(); if (GLContext.CONTEXT_NOT_CURRENT != res) { if(GLContext.CONTEXT_CURRENT_NEW == res) { - throw new GLException(Thread.currentThread().getName()+" GLDrawableHelper " + this + ".invokeGL(): Dispose case (no init action given): Native context was not created (new ctx): "+context); + throw new GLException(getThreadName()+" GLDrawableHelper " + this + ".invokeGL(): Dispose case (no init action given): Native context was not created (new ctx): "+context); } if( listeners.size() > 0 && null != autoDrawable ) { disposeAllGLEventListener(autoDrawable, false); @@ -950,7 +950,7 @@ public class GLDrawableHelper { } flushGLRunnables(); } catch (Exception e) { - System.err.println("Catched: "+e.getMessage()); + System.err.println("Catched Exception on thread "+getThreadName()); e.printStackTrace(); } if (lastContext != null) { @@ -1036,7 +1036,7 @@ public class GLDrawableHelper { try { context.release(); } catch (Exception e) { - System.err.println("Catched: "+e.getMessage()); + System.err.println("Catched Exception on thread "+getThreadName()); e.printStackTrace(); } } @@ -1142,7 +1142,7 @@ public class GLDrawableHelper { context.release(); ctxReleased = true; } catch (Exception e) { - System.err.println("Catched: "+e.getMessage()); + System.err.println("Catched Exception on thread "+getThreadName()); e.printStackTrace(); } } @@ -1160,5 +1160,7 @@ public class GLDrawableHelper { long td = System.currentTimeMillis() - t0; System.err.println("td0 "+td+"ms, fps "+(1.0/(td/1000.0))+", td-makeCurrent: "+tdA+"ms, td-render "+tdR+"ms, td-swap "+tdS+"ms, td-release "+tdX+"ms, ctx claimed: "+ctxClaimed+", ctx release: "+ctxReleased+", ctx destroyed "+ctxDestroyed); } + + protected static String getThreadName() { return Thread.currentThread().getName(); } } |