From 5e01e993aeba4e95fc8aa6e75b3e295011e27bbb Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 25 Jun 2013 09:03:28 +0200 Subject: AbstractBuffer: Generalize 'capacity' calculation, since we may encounter a byte-buffer w/ given elementSize semantics --- src/java/com/jogamp/common/nio/AbstractBuffer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java/com/jogamp/common/nio/AbstractBuffer.java b/src/java/com/jogamp/common/nio/AbstractBuffer.java index 985ba4f..2624254 100644 --- a/src/java/com/jogamp/common/nio/AbstractBuffer.java +++ b/src/java/com/jogamp/common/nio/AbstractBuffer.java @@ -59,7 +59,7 @@ public abstract class AbstractBuffer implements Native this.elementSize = elementSize; this.buffer = buffer; - capacity = buffer.capacity() /* / elementSize */; + capacity = ( Buffers.sizeOfBufferElem(buffer) * buffer.capacity() ) / elementSize ; position = 0; } -- cgit v1.2.3