From a302c87258a1a17dc0eef5ae112cb0d4357be238 Mon Sep 17 00:00:00 2001
From: Kenneth Russel <kbrussel@alum.mit.edu>
Date: Mon, 6 Feb 2006 04:52:15 +0000
Subject: Further work on FBO support in Java2D/JOGL bridge. Recast how
 GLObjectTrackers are specified between contexts and separated this from the
 maintenance of the GLContextShareSet, although the API
 (registerForObjectTracking) is in the GLContextShareSet class. If the
 Java2D/OpenGL pipeline and FBOs are active, causes all JOGL contexts created
 to share textures and display lists with a context from Java2D (currently
 acquired from a VolatileImage, but will probably need to change how this is
 done). GLObjectTrackers however are only shared between JOGL contexts where
 the user has explicitly requested sharing. This yields the expected semantics
 of server-side object deletion when the context is destroyed. Upgraded
 GLJPanel to handle FBO manipulation. Not working yet; more debugging
 necessary on Java2D side as well.

git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@585 232f8b59-042b-4e1e-8c03-345bb8c30851
---
 src/classes/com/sun/opengl/impl/GLContextImpl.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(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 5dbf08df6..d79de9f5a 100644
--- a/src/classes/com/sun/opengl/impl/GLContextImpl.java
+++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -66,9 +66,11 @@ public abstract class GLContextImpl extends GLContext {
   public GLContextImpl(GLContext shareWith) {
     setGL(createGL());
     functionAvailability = new FunctionAvailabilityCache(this);
-    if (shareWith != null || GLContextShareSet.isObjectTrackingDebuggingEnabled()) {
-      GLContextShareSet.registerSharing(this, shareWith);
+    GLContext shareContext = Java2D.filterShareContext(shareWith);
+    if (shareContext != null) {
+      GLContextShareSet.registerSharing(this, shareContext);
     }
+    GLContextShareSet.registerForObjectTracking(shareWith, this);
   }
 
   public int makeCurrent() throws GLException {
-- 
cgit v1.2.3