From 53ff91470b73f2f12f0d1cf5cf800a13e46e026e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 28 Jun 2012 20:56:25 +0200 Subject: GLContext* TRACE_SWITCH: Add GLContext instance hash value to allow tracking. --- src/jogl/classes/javax/media/opengl/GLContext.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/javax/media/opengl/GLContext.java') diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index 19501e589..dfae76e73 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -52,6 +52,7 @@ import com.jogamp.common.util.locks.RecursiveLock; import jogamp.opengl.Debug; import jogamp.opengl.GLContextImpl; +import jogamp.opengl.GLContextShareSet; /** Abstraction for an OpenGL rendering context. In order to perform OpenGL rendering, a context must be "made current" on the current @@ -303,7 +304,11 @@ public abstract class GLContext { */ protected static void setCurrent(GLContext cur) { if(TRACE_SWITCH) { - System.err.println(getThreadName()+": GLContext.ContextSwitch: - setCurrent() - "+cur); + if(null == cur) { + System.err.println(getThreadName()+": GLContext.ContextSwitch: - setCurrent() - NULL"); + } else { + System.err.println(getThreadName()+": GLContext.ContextSwitch: - setCurrent() - obj " + toHexString(cur.hashCode()) + ", ctx " + toHexString(cur.getHandle())); + } } currentContext.set(cur); } @@ -404,6 +409,8 @@ public abstract class GLContext { sb.append(Integer.toHexString(ctxOptions)); sb.append(", "); sb.append(getGLVersion()); + sb.append(", this "); + sb.append(toHexString(hashCode())); sb.append(", handle "); sb.append(toHexString(contextHandle)); sb.append(", "); -- cgit v1.2.3