From aa7cbaea0c6998644ca9311f269ba0aae224d1c4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 27 Oct 2013 18:52:00 +0100 Subject: Fix GLCanvas ctor shared GLContext: Use helper.setSharedContext(..) remove local shared ctx fields. Regression of 7f7a23dd0ddf106e6f0c69fc2a05ff92ac56200e --- src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 7 +++---- .../opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java | 2 +- .../test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index b070ddd7d..c2d8e0535 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -173,9 +173,6 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing private final GraphicsDevice device; private boolean shallUseOffscreenLayer = false; - protected GLContext sharedContext = null; - protected GLAutoDrawable sharedAutoDrawable = null; - private final AWTWindowClosingProtocol awtWindowClosingProtocol = new AWTWindowClosingProtocol(this, new Runnable() { @Override @@ -293,7 +290,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing // instantiation will be issued in addNotify() this.capsReqUser = capsReqUser; this.chooser = chooser; - this.sharedContext = shareWith; + if( null != shareWith ) { + helper.setSharedContext(null, shareWith); + } this.device = device; } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java index d3b5042fc..6b9169510 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java @@ -88,7 +88,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase { frame.add(glCanvas); frame.setLocation(x, y); frame.setSize(width, height); - frame.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared true"); + frame.setTitle("Shared Gears AWT GLCanvas Test: "+x+"/"+y+" shared true"); return glCanvas; } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java index e49f4e27e..71993a023 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java @@ -207,6 +207,7 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase { @Test public void test01() throws InterruptedException, InvocationTargetException { final JFrame f = new JFrame(); + f.setTitle("Shared GLContext AWT GLCanvas JTabbedPane"); final DemoInstance demo = new DemoInstance(f); SwingUtilities.invokeLater(new Runnable() { public void run() { -- cgit v1.2.3