From 6b924839b33dbf507dd9eebc0ad5b5fbf23f4fb2 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 13 Mar 2013 01:29:50 +0100 Subject: *External*Context Impl: Remove unused 'lastContext' field, incl. their makeCurrent() and release() override. Semantics of 'lastContext' are plain wrong, since release() override does claim the previous 'lastContext' is current at the end - however, it wasn't technically made current. --- .../jogamp/opengl/egl/EGLExternalContext.java | 25 +--------------------- .../macosx/cgl/MacOSXExternalCGLContext.java | 20 ----------------- .../windows/wgl/WindowsExternalWGLContext.java | 22 +------------------ .../opengl/x11/glx/X11ExternalGLXContext.java | 20 ----------------- 4 files changed, 2 insertions(+), 85 deletions(-) (limited to 'src/jogl/classes') diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java index da8fb519d..4685e8bf1 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java @@ -36,11 +36,11 @@ package jogamp.opengl.egl; import javax.media.opengl.*; + import jogamp.opengl.*; import javax.media.nativewindow.*; public class EGLExternalContext extends EGLContext { - private GLContext lastContext; public EGLExternalContext(AbstractGraphicsScreen screen) { super(null, null); @@ -49,29 +49,6 @@ public class EGLExternalContext extends EGLContext { getGLStateTracker().setEnabled(false); // external context usage can't track state in Java } - @Override - public int makeCurrent() throws GLException { - // Save last context if necessary to allow external GLContexts to - // talk to other GLContexts created by this library - GLContext cur = getCurrent(); - if (cur != null && cur != this) { - lastContext = cur; - setCurrent(null); - } - return super.makeCurrent(); - } - - @Override - public void release() throws GLException { - super.release(); - setCurrent(lastContext); - lastContext = null; - } - - @Override - protected void makeCurrentImpl() throws GLException { - } - @Override protected void releaseImpl() throws GLException { } diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java index f121a2547..d23d8a7e1 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java @@ -57,7 +57,6 @@ import jogamp.opengl.macosx.cgl.MacOSXCGLDrawable.GLBackendType; public class MacOSXExternalCGLContext extends MacOSXCGLContext { - private GLContext lastContext; private MacOSXExternalCGLContext(Drawable drawable, boolean isNSContext, long handle) { super(drawable, null); @@ -122,25 +121,6 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext { return true; } - @Override - public int makeCurrent() throws GLException { - // Save last context if necessary to allow external GLContexts to - // talk to other GLContexts created by this library - GLContext cur = getCurrent(); - if (cur != null && cur != this) { - lastContext = cur; - setCurrent(null); - } - return super.makeCurrent(); - } - - @Override - public void release() throws GLException { - super.release(); - setCurrent(lastContext); - lastContext = null; - } - @Override protected void makeCurrentImpl() throws GLException { } diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java index 84b29a09f..a5893775a 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java @@ -56,8 +56,7 @@ import jogamp.nativewindow.windows.GDI; import jogamp.opengl.GLContextShareSet; public class WindowsExternalWGLContext extends WindowsWGLContext { - private GLContext lastContext; - + private WindowsExternalWGLContext(Drawable drawable, long ctx, WindowsWGLGraphicsConfiguration cfg) { super(drawable, null); this.contextHandle = ctx; @@ -105,25 +104,6 @@ public class WindowsExternalWGLContext extends WindowsWGLContext { return new WindowsExternalWGLContext(new Drawable(factory, new WrappedSurface(cfg, hdc, 64, 64, true)), ctx, cfg); } - @Override - public int makeCurrent() throws GLException { - // Save last context if necessary to allow external GLContexts to - // talk to other GLContexts created by this library - GLContext cur = getCurrent(); - if (cur != null && cur != this) { - lastContext = cur; - setCurrent(null); - } - return super.makeCurrent(); - } - - @Override - public void release() throws GLException { - super.release(); - setCurrent(lastContext); - lastContext = null; - } - @Override protected void makeCurrentImpl() throws GLException { } diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java index 12fa5786a..72e84b05e 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java @@ -58,7 +58,6 @@ import com.jogamp.common.nio.Buffers; import com.jogamp.nativewindow.x11.X11GraphicsScreen; public class X11ExternalGLXContext extends X11GLXContext { - private GLContext lastContext; private X11ExternalGLXContext(Drawable drawable, long ctx) { super(drawable, null); @@ -117,25 +116,6 @@ public class X11ExternalGLXContext extends X11GLXContext { return true; } - @Override - public int makeCurrent() throws GLException { - // Save last context if necessary to allow external GLContexts to - // talk to other GLContexts created by this library - GLContext cur = getCurrent(); - if (cur != null && cur != this) { - lastContext = cur; - setCurrent(null); - } - return super.makeCurrent(); - } - - @Override - public void release() throws GLException { - super.release(); - setCurrent(lastContext); - lastContext = null; - } - @Override protected void makeCurrentImpl() throws GLException { } -- cgit v1.2.3