diff options
Diffstat (limited to 'src/classes/com')
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; } |