diff options
Diffstat (limited to 'src/classes/javax/media/opengl/awt')
-rw-r--r-- | src/classes/javax/media/opengl/awt/GLCanvas.java | 4 | ||||
-rw-r--r-- | src/classes/javax/media/opengl/awt/GLJPanel.java | 25 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/classes/javax/media/opengl/awt/GLCanvas.java b/src/classes/javax/media/opengl/awt/GLCanvas.java index bce58be0f..e0d997dc5 100644 --- a/src/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/classes/javax/media/opengl/awt/GLCanvas.java @@ -373,6 +373,10 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { drawableHelper.removeGLEventListener(listener); } + public void setContext(GLContext ctx) { + context=(GLContextImpl)ctx; + } + public GLContext getContext() { return context; } diff --git a/src/classes/javax/media/opengl/awt/GLJPanel.java b/src/classes/javax/media/opengl/awt/GLJPanel.java index d5f44ff21..37f1dfa7b 100644 --- a/src/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/classes/javax/media/opengl/awt/GLJPanel.java @@ -324,6 +324,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { public void setRealized(boolean realized) { } + public void setContext(GLContext ctx) { + if (backend == null) { + return; + } + backend.setContext(ctx); + } + public GLContext getContext() { if (backend == null) { return null; @@ -565,6 +572,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { // this GLJPanel public GLContext createContext(GLContext shareWith); + // Called to set the current backend's GLContext + public void setContext(GLContext ctx); + // Called to get the current backend's GLContext public GLContext getContext(); @@ -797,6 +807,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { return offscreenDrawable.createContext(shareWith); } + public void setContext(GLContext ctx) { + offscreenContext=(GLContextImpl)ctx; + } + public GLContext getContext() { return offscreenContext; } @@ -873,6 +887,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { return pbuffer.createContext(shareWith); } + public void setContext(GLContext ctx) { + if (pbuffer == null && Beans.isDesignTime()) { + return; + } + pbuffer.setContext(ctx); + } + public GLContext getContext() { // Workaround for crashes in NetBeans GUI builder if (pbuffer == null && Beans.isDesignTime()) { @@ -1040,6 +1061,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { throw new GLException("Not yet implemented"); } + public void setContext(GLContext ctx) { + joglContext=ctx; + } + public GLContext getContext() { return joglContext; } |