aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-02-11 09:10:53 +0000
committerKenneth Russel <[email protected]>2006-02-11 09:10:53 +0000
commita94644036bfcf0792aece52910dc32dda556d002 (patch)
tree0e5ae031bc4fbd1f025d39a42e1bba4144c9e2f6 /src/classes/com/sun
parentf94cb4c86f3d136364aa722514865caa85824da3 (diff)
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
Diffstat (limited to 'src/classes/com/sun')
-rw-r--r--src/classes/com/sun/opengl/impl/GLContextImpl.java9
-rw-r--r--src/classes/com/sun/opengl/impl/windows/WindowsDummyGLDrawable.java2
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/windows/WindowsExternalGLContext.java2
-rw-r--r--src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java8
4 files changed, 17 insertions, 4 deletions
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;
}