summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2013-06-25 09:03:28 +0200
committerSven Gothel <sgothel@jausoft.com>2013-06-25 09:03:28 +0200
commit5e01e993aeba4e95fc8aa6e75b3e295011e27bbb (patch)
treefae590ee3e3fd6700eb21f04d8fdc87d8d07fc0e
parent6ff3fe730671b0bfed61b56e1179aaecd39f53a5 (diff)
AbstractBuffer: Generalize 'capacity' calculation, since we may encounter a byte-buffer w/ given elementSize semantics
-rw-r--r--src/java/com/jogamp/common/nio/AbstractBuffer.java2
1 files changed, 1 insertions, 1 deletions
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<B extends AbstractBuffer> implements Native
this.elementSize = elementSize;
this.buffer = buffer;
- capacity = buffer.capacity() /* / elementSize */;
+ capacity = ( Buffers.sizeOfBufferElem(buffer) * buffer.capacity() ) / elementSize ;
position = 0;
}