From ce18ee62ab347529a281e936e819377c10d51d26 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sun, 19 Mar 2006 01:20:43 +0000 Subject: Added fallback path in GLContext optimization code to be able to disable behavior of leaving last context current on OpenGL worker thread. Currently can be manually disabled with -Djogl.GLContext.noopt. Added explicit test on X11 platforms of whether the onscreen context created is direct or not, and to disable context optimization if not, to automatically solve problems when running with indirect contexts typically from Mesa. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@668 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/GLContextImpl.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/classes/com/sun/opengl/impl/GLContextImpl.java') diff --git a/src/classes/com/sun/opengl/impl/GLContextImpl.java b/src/classes/com/sun/opengl/impl/GLContextImpl.java index 8963b2f5e..d363cfe80 100644 --- a/src/classes/com/sun/opengl/impl/GLContextImpl.java +++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java @@ -50,6 +50,7 @@ public abstract class GLContextImpl extends GLContext { protected static final boolean DEBUG = Debug.debug("GLContextImpl"); protected static final boolean VERBOSE = Debug.verbose(); protected static final boolean NO_FREE = Debug.isPropertyDefined("jogl.GLContext.nofree"); + protected boolean optimizationEnabled = !Debug.isPropertyDefined("jogl.GLContext.noopt"); // Cache of the functions that are available to be called at the current // moment in time @@ -351,6 +352,11 @@ public abstract class GLContextImpl extends GLContext { return "0x" + Long.toHexString(hex); } + //--------------------------------------------------------------------------- + // Helpers for integration with Java2D/OpenGL pipeline when FBOs are + // being used + // + public void setObjectTracker(GLObjectTracker tracker) { this.tracker = tracker; } @@ -367,6 +373,15 @@ public abstract class GLContextImpl extends GLContext { return deletedObjectTracker; } + //--------------------------------------------------------------------------- + // Helpers for context optimization where the last context is left + // current on the OpenGL worker thread + // + + public boolean isOptimizable() { + return optimizationEnabled; + } + public boolean hasWaiters() { return lock.hasWaiters(); } -- cgit v1.2.3