summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-01-13 11:43:35 +0100
committerSven Gothel <[email protected]>2012-01-13 11:43:35 +0100
commitd23b08203e32f8f50991a48132eb3c2236b4efc0 (patch)
tree3d2936474900284fc576000c777099caa4d1bc88 /src/jogl/classes/javax
parent835b36d626f75f9e96001a41c2a6fe9f90466ae1 (diff)
OSX Fix: Catch releaseImpl's glFinish() exception (DebugGL); Make GLContext.release's setCurrent(null) exception prone.
Catch releaseImpl's glFinish() exception (DebugGL) glGetError() after glFinish() (eg. w/ debug pipeline) produced unknown error 0x0506 on OS X (10.7.2 NV). Make GLContext.release's setCurrent(null) exception prone Call setCurrent(null) in finalizer block to ensure it's 'released' out of the TLS even when an exception is being thrown. Make MacOSX Shared Resources 'destroy' more error prone (catch exceptions)
Diffstat (limited to 'src/jogl/classes/javax')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 8626400f7..131f42e06 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -69,7 +69,8 @@ import jogamp.opengl.GLContextImpl;
refer to a given context. */
public abstract class GLContext {
public static final boolean DEBUG = Debug.debug("GLContext");
-
+
+ public static final boolean TRACE_SWITCH;
/** Reflects property jogl.debug.DebugGL. If true, the debug pipeline is enabled at context creation. */
public final static boolean DEBUG_GL;
/** Reflects property jogl.debug.TraceGL. If true, the trace pipeline is enabled at context creation. */
@@ -79,6 +80,7 @@ public abstract class GLContext {
final AccessControlContext acl = AccessController.getContext();
DEBUG_GL = Debug.isPropertyDefined("jogl.debug.DebugGL", true, acl);
TRACE_GL = Debug.isPropertyDefined("jogl.debug.TraceGL", true, acl);
+ TRACE_SWITCH = Debug.isPropertyDefined("jogl.debug.GLContext.TraceSwitch", true, acl);
}
/** Indicates that the context was not made current during the last call to {@link #makeCurrent makeCurrent}. */
@@ -295,6 +297,9 @@ public abstract class GLContext {
* new GLContext implementations; not for use by end users.
*/
protected static void setCurrent(GLContext cur) {
+ if(TRACE_SWITCH) {
+ System.err.println("GLContext.ContextSwitch: - setCurrent() - "+Thread.currentThread().getName()+": "+cur);
+ }
currentContext.set(cur);
}