From a94644036bfcf0792aece52910dc32dda556d002 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sat, 11 Feb 2006 09:10:53 +0000 Subject: Completion of initial work on FBO support in Java2D/JOGL bridge. Discovered it was necessary to re-attach the color and depth renderbuffers to the FBO in JOGL's context, even though it shared textures and display lists with Java2D's context; this may be a driver problem and merits further investigation. Found it was also necessary to create a new depth renderbuffer; apparently could not use Java2D's. This is almost certainly a driver bug. At this point, with the forthcoming planned changes to Mustang, JOGL works when -Dsun.java2d.opengl.fbobject=true is specified. Problems remain with the HWShadowmapsSimple (extremely slow performance) and InfiniteShadowVolumes (throws exception because of inability to share textures and display lists between pbuffer's context with stencil buffer and Java2D's context) demos. Worked around earlier exceptions with InfiniteShadowvolumes demo by avoiding sharing textures and display lists with dummy GLContexts. Changed build to produce DebugGL and TraceGL earlier so they can be used in e.g. GLJPanel. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@599 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/GLContextImpl.java | 9 ++++++++- .../com/sun/opengl/impl/windows/WindowsDummyGLDrawable.java | 2 +- .../com/sun/opengl/impl/windows/WindowsExternalGLContext.java | 2 +- src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java | 8 +++++++- 4 files changed, 17 insertions(+), 4 deletions(-) (limited to 'src/classes/com/sun/opengl/impl') diff --git a/src/classes/com/sun/opengl/impl/GLContextImpl.java b/src/classes/com/sun/opengl/impl/GLContextImpl.java index 0910fe250..5f945a334 100644 --- a/src/classes/com/sun/opengl/impl/GLContextImpl.java +++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java @@ -64,9 +64,16 @@ public abstract class GLContextImpl extends GLContext { protected GL gl; public GLContextImpl(GLContext shareWith) { + this(shareWith, false); + } + + public GLContextImpl(GLContext shareWith, boolean dontShareWithJava2D) { setGL(createGL()); functionAvailability = new FunctionAvailabilityCache(this); - GLContext shareContext = Java2D.filterShareContext(shareWith); + GLContext shareContext = shareWith; + if (!dontShareWithJava2D) { + shareContext = Java2D.filterShareContext(shareWith); + } if (shareContext != null) { GLContextShareSet.registerSharing(this, shareContext); } diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsDummyGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/WindowsDummyGLDrawable.java index e4d4d26d0..a307493d7 100644 --- a/src/classes/com/sun/opengl/impl/windows/WindowsDummyGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/windows/WindowsDummyGLDrawable.java @@ -80,7 +80,7 @@ public class WindowsDummyGLDrawable extends WindowsGLDrawable { // Construction failed return null; } - return new WindowsGLContext(this, shareWith); + return new WindowsGLContext(this, shareWith, true); } public void destroy() { diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java b/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java index c56614599..cd51f4eb1 100755 --- a/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java +++ b/src/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java @@ -49,7 +49,7 @@ public class WindowsExternalGLContext extends WindowsGLContext { private boolean created = true; public WindowsExternalGLContext() { - super(null, null); + super(null, null, true); hglrc = WGL.wglGetCurrentContext(); if (hglrc == 0) { throw new GLException("Error: attempted to make an external GLContext without a drawable/context current"); diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java b/src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java index e93c7fb3b..7a827854c 100644 --- a/src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java +++ b/src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java @@ -68,7 +68,13 @@ public class WindowsGLContext extends GLContextImpl { public WindowsGLContext(WindowsGLDrawable drawable, GLContext shareWith) { - super(shareWith); + this(drawable, shareWith, false); + } + + public WindowsGLContext(WindowsGLDrawable drawable, + GLContext shareWith, + boolean dontShareWithJava2D) { + super(shareWith, dontShareWithJava2D); this.drawable = drawable; } -- cgit v1.2.3