diff options
author | Sven Gothel <[email protected]> | 2013-05-17 08:48:57 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-05-17 08:48:57 +0200 |
commit | 9fbcc16eb37b35f4f0f02e74be6ab14169e3bad0 (patch) | |
tree | 50547831d7f10b8ba8eec43af615ddd344ac5a16 /src/jogl/classes/com/jogamp/opengl | |
parent | 1cc44101bd4f44407929c686d3c6e00d36793495 (diff) |
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)
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java | 11 |
1 files changed, 6 insertions, 5 deletions
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. * <p> * It is assumed that <code>pixelAttributes</code>, <code>depth</code> and <code>pack</code> stays the same! * </p> @@ -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(); } } |