summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2008-03-30 23:39:11 +0000
committerKenneth Russel <[email protected]>2008-03-30 23:39:11 +0000
commitd0c380ed9959daeb727a4b889a342096373bd79a (patch)
tree740901e67f27880a1d64db8c440100ef02933371
parente995774d7cb2ea6c60ec763f04cf22dffbb6531a (diff)
Fixed Issue 279: GLJPanel.setAutoSwapBufferMode(false) throws NPE
This issue turned up with NASA World Wind Java as well as with this bug report. The current situation is that GLJPanel.setAutoSwapBufferMode() and GLJPanel.swapBuffers() have no effect due to how the Swing-compatible GLJPanel works, and due to the fact that the backing OpenGL drawables for the GLJPanel are always single-buffered. Therefore there is no adverse effect to current applications to simply making setAutoSwapBufferMode and swapBuffers no-ops, and returning "true" from getAutoSwapBufferMode (although the latter is a change in behavior, it reflects the current reality). git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1582 232f8b59-042b-4e1e-8c03-345bb8c30851
-rw-r--r--src/classes/javax/media/opengl/GLJPanel.java43
1 files changed, 16 insertions, 27 deletions
diff --git a/src/classes/javax/media/opengl/GLJPanel.java b/src/classes/javax/media/opengl/GLJPanel.java
index 2d4e84d77..6be6fa2b9 100644
--- a/src/classes/javax/media/opengl/GLJPanel.java
+++ b/src/classes/javax/media/opengl/GLJPanel.java
@@ -804,39 +804,28 @@ public class GLJPanel extends JPanel implements GLAutoDrawable {
}
public void setAutoSwapBufferMode(boolean onOrOff) {
- if (!hardwareAccelerationDisabled) {
- // Workaround for crashes in NetBeans GUI builder
- if (pbuffer == null && Beans.isDesignTime()) {
- return;
- }
- pbuffer.setAutoSwapBufferMode(onOrOff);
- } else {
- drawableHelper.setAutoSwapBufferMode(onOrOff);
- }
+ // In the current implementation this is a no-op. Both the pbuffer
+ // and pixmap based rendering paths use a single-buffered surface
+ // so swapping the buffers doesn't do anything. We also don't
+ // currently have the provision to skip copying the data to the
+ // Swing portion of the GLJPanel in any of the rendering paths.
}
public boolean getAutoSwapBufferMode() {
- if (!hardwareAccelerationDisabled && !oglPipelineEnabled) {
- return pbuffer.getAutoSwapBufferMode();
- } else {
- return drawableHelper.getAutoSwapBufferMode();
- }
+ // In the current implementation this is a no-op. Both the pbuffer
+ // and pixmap based rendering paths use a single-buffered surface
+ // so swapping the buffers doesn't do anything. We also don't
+ // currently have the provision to skip copying the data to the
+ // Swing portion of the GLJPanel in any of the rendering paths.
+ return true;
}
public void swapBuffers() {
- // In the current implementation this is basically a no-op. Both
- // the pbuffer and pixmap based rendering paths use a single-
- // buffered surface so swapping the buffers doesn't do anything.
- // We also don't currently have the provision to skip copying the
- // data to the Swing portion of the GLJPanel in any of the
- // rendering paths.
- if (oglPipelineEnabled) {
- // Do nothing
- } else if (!hardwareAccelerationDisabled) {
- pbuffer.swapBuffers();
- } else {
- drawableHelper.invokeGL(offscreenDrawable, offscreenContext, swapBuffersAction, initAction);
- }
+ // In the current implementation this is a no-op. Both the pbuffer
+ // and pixmap based rendering paths use a single-buffered surface
+ // so swapping the buffers doesn't do anything. We also don't
+ // currently have the provision to skip copying the data to the
+ // Swing portion of the GLJPanel in any of the rendering paths.
}
/** For a translucent GLJPanel (one for which {@link #setOpaque