aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-04-17 05:33:23 +0000
committerKenneth Russel <[email protected]>2007-04-17 05:33:23 +0000
commit357d2cbcc498be65055d6b1ea8a6176ffb4c907c (patch)
tree0f58276452563dabd4a7f0cb8be16e571f8d997b /src
parent915f09c3330d1e3a375c36bc853febf10a8591c1 (diff)
Fixed Issue 290: GLJPanel throws NullPointerExceptions with Java 2D/JOGL bridge
Fixed NPEs in setAutoSwapBufferMode and swapBuffers if Java 2D / JOGL bridge is enabled. These methods are essentially no-ops on the GLJPanel anyway because of how the copying to the Swing rendering area (be it a BufferedImage or the Swing back buffer) is done. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1199 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r--src/classes/javax/media/opengl/GLJPanel.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/classes/javax/media/opengl/GLJPanel.java b/src/classes/javax/media/opengl/GLJPanel.java
index 3e08ab079..180ae2111 100644
--- a/src/classes/javax/media/opengl/GLJPanel.java
+++ b/src/classes/javax/media/opengl/GLJPanel.java
@@ -795,7 +795,7 @@ public class GLJPanel extends JPanel implements GLAutoDrawable {
}
public boolean getAutoSwapBufferMode() {
- if (!hardwareAccelerationDisabled) {
+ if (!hardwareAccelerationDisabled && !oglPipelineEnabled) {
return pbuffer.getAutoSwapBufferMode();
} else {
return drawableHelper.getAutoSwapBufferMode();
@@ -803,7 +803,15 @@ public class GLJPanel extends JPanel implements GLAutoDrawable {
}
public void swapBuffers() {
- if (!hardwareAccelerationDisabled) {
+ // 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);