diff options
author | Kenneth Russel <[email protected]> | 2006-03-19 01:20:43 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-03-19 01:20:43 +0000 |
commit | ce18ee62ab347529a281e936e819377c10d51d26 (patch) | |
tree | 575d6eaf1d0e171743617333ab16b90ba14f5d2b /src/classes/com/sun/opengl/impl/GLDrawableHelper.java | |
parent | 75583e919e4245352112b86d6f0922f5af70afe2 (diff) |
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
Diffstat (limited to 'src/classes/com/sun/opengl/impl/GLDrawableHelper.java')
-rw-r--r-- | src/classes/com/sun/opengl/impl/GLDrawableHelper.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLDrawableHelper.java b/src/classes/com/sun/opengl/impl/GLDrawableHelper.java index 920fac624..2a96e2958 100644 --- a/src/classes/com/sun/opengl/impl/GLDrawableHelper.java +++ b/src/classes/com/sun/opengl/impl/GLDrawableHelper.java @@ -105,8 +105,13 @@ public class GLDrawableHelper { GLContext context, Runnable runnable, Runnable initAction) { + // FIXME: downcast to GLContextImpl undesirable + boolean isOptimizable = ((context instanceof GLContextImpl) && + ((GLContextImpl) context).isOptimizable()); + if (GLWorkerThread.isStarted() && - GLWorkerThread.isWorkerThread()) { + GLWorkerThread.isWorkerThread() && + isOptimizable) { // We're going to allow a context to be left current on the // GLWorkerThread for optimization purposes GLContext lastContext = GLContext.getCurrent(); |