From 9fbcc16eb37b35f4f0f02e74be6ab14169e3bad0 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 17 May 2013 08:48:57 +0200 Subject: GLPixelBuffer.dispose(): Set diposed:=true to allow isValid() to work properly; GLJPanel: Rely on GLPixelBuffer.requiresNewBuffer(..) for each frame, don't use local pixelBufferCheckSize (buggy w/ singleton) --- src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index 7359e1b47..b11f359be 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -978,7 +978,6 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing private final AWTGLPixelBufferProvider pixelBufferProvider; private final boolean useSingletonBuffer; private AWTGLPixelBuffer pixelBuffer; - private boolean pixelBufferCheckSize; // One of these is used to store the read back pixels before storing // in the BufferedImage @@ -1160,14 +1159,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing if( useSingletonBuffer ) { // attempt to fetch the latest AWTGLPixelBuffer pixelBuffer = (AWTGLPixelBuffer) ((SingletonGLPixelBufferProvider)pixelBufferProvider).getSingleBuffer(pixelAttribs); } - if( pixelBufferCheckSize ) { - pixelBufferCheckSize = false; - if( null != pixelBuffer && pixelBuffer.requiresNewBuffer(gl, panelWidth, panelHeight, 0) ) { - pixelBuffer.dispose(); - pixelBuffer = null; - } + if( null != pixelBuffer && pixelBuffer.requiresNewBuffer(gl, panelWidth, panelHeight, 0) ) { + pixelBuffer.dispose(); + pixelBuffer = null; } - if ( null == pixelBuffer ) { if (0 >= panelWidth || 0 >= panelHeight ) { return; @@ -1300,8 +1295,6 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing } } } - - pixelBufferCheckSize = true; return _drawable.isRealized(); } -- cgit v1.2.3