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/com/jogamp/opengl/util/GLPixelBuffer.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/jogl/classes/com') diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java index 6b9d3bf2c..b0fc7f332 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java @@ -212,7 +212,7 @@ public class GLPixelBuffer { this.bufferElemSize = Buffers.sizeOfBufferElem(buffer); } - /** Is not {@link #dispose()} and has {@link #byteSize} > 0. */ + /** Is not {@link #dispose() disposed} and has {@link #byteSize} > 0. */ public boolean isValid() { return !disposed && 0 < byteSize; } @@ -240,8 +240,8 @@ public class GLPixelBuffer { } /** - * Returns true, if implementation requires a new buffer based on the new size - * due to pixel alignment or byte size or if {@link #isValid() invalid}, otherwise false. + * Returns true, if {@link #isValid() invalid} or implementation requires a new buffer based on the new size + * due to pixel alignment or byte size, otherwise false. *

* It is assumed that pixelAttributes, depth and pack stays the same! *

@@ -257,11 +257,12 @@ public class GLPixelBuffer { * @see GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) */ public boolean requiresNewBuffer(GL gl, int newWidth, int newHeight, int minByteSize) { - return !isValid() || this.byteSize < minByteSize; + return !isValid() || byteSize < minByteSize; } - /** Dispose resources. */ + /** Dispose resources. See {@link #isValid()}. */ public void dispose() { + disposed = true; buffer.clear(); } } -- cgit v1.2.3