From 8ebdef6860e34bf16b9b13c657f651bf9ce32ab3 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sat, 11 Feb 2006 01:11:57 +0000 Subject: Further work on FBO support in Java2D/JOGL bridge. Upgraded JOGL's Java2D class to latest proposed set of APIs in OGLUtilities and changed usage of these APIs to be approximately correct. Left in fallback path for working with non-FBO case in current Mustang builds. Not working yet, and don't yet understand why; checking in at this intermediate point to be able to more easily test on more machines. Added error checking to creation of external GLContexts and GLDrawables on Windows and X11 platforms. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@597 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../com/sun/opengl/impl/GLContextShareSet.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/classes/com/sun/opengl/impl/GLContextShareSet.java') diff --git a/src/classes/com/sun/opengl/impl/GLContextShareSet.java b/src/classes/com/sun/opengl/impl/GLContextShareSet.java index 283a56f85..20a9364fb 100644 --- a/src/classes/com/sun/opengl/impl/GLContextShareSet.java +++ b/src/classes/com/sun/opengl/impl/GLContextShareSet.java @@ -39,6 +39,9 @@ package com.sun.opengl.impl; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; import java.lang.ref.*; import java.util.*; import javax.media.opengl.*; @@ -168,10 +171,20 @@ public class GLContextShareSet { GLContextImpl impl2 = (GLContextImpl) newContext; GLObjectTracker tracker = null; // Don't share object trackers with the primordial share context from Java2D - GLContext j2dShareContext = Java2D.getShareContext(); - if (impl1 != null && impl1 == j2dShareContext) { - impl1 = null; + if (Java2D.isOGLPipelineActive()) { + // FIXME: probably need to do something different here + // Need to be able to figure out the GraphicsDevice for the + // older context if it's on-screen + GraphicsConfiguration gc = GraphicsEnvironment. + getLocalGraphicsEnvironment(). + getDefaultScreenDevice(). + getDefaultConfiguration(); + GLContext j2dShareContext = Java2D.getShareContext(gc); + if (impl1 != null && impl1 == j2dShareContext) { + impl1 = null; + } } + if (impl1 != null) { tracker = impl1.getObjectTracker(); assert (tracker != null) -- cgit v1.2.3