diff options
Diffstat (limited to 'src/classes/javax/media/opengl/awt/GLJPanel.java')
-rw-r--r-- | src/classes/javax/media/opengl/awt/GLJPanel.java | 25 |
1 files changed, 25 insertions, 0 deletions
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; } |