aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/nio/CachedBufferFactory.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-02-22 17:34:47 +0100
committerSven Gothel <[email protected]>2011-02-22 17:34:47 +0100
commitec4fcc9699db753a6d462c8c3df7ba71949c9fdd (patch)
tree00812e354af24c048899be2aae3b6db11ded2d28 /src/java/com/jogamp/common/nio/CachedBufferFactory.java
parent65ab75dec5b3ab063a5cdb034325426d27e3b425 (diff)
parent0fea7dfb1514ab1c3d5765057975be50d7282d0d (diff)
Merge remote branch 'mbien/master'
Diffstat (limited to 'src/java/com/jogamp/common/nio/CachedBufferFactory.java')
-rw-r--r--src/java/com/jogamp/common/nio/CachedBufferFactory.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/nio/CachedBufferFactory.java b/src/java/com/jogamp/common/nio/CachedBufferFactory.java
index 36bac13..dbeed2d 100644
--- a/src/java/com/jogamp/common/nio/CachedBufferFactory.java
+++ b/src/java/com/jogamp/common/nio/CachedBufferFactory.java
@@ -168,7 +168,7 @@ public class CachedBufferFactory {
public ByteBuffer newDirectByteBuffer(int size) {
// if large enough... just create it
- if (size >= currentBuffer.capacity()) {
+ if (size > currentBuffer.capacity()) {
checkIfFixed();
return Buffers.newDirectByteBuffer(size);
}
@@ -180,7 +180,7 @@ public class CachedBufferFactory {
}
currentBuffer.limit(currentBuffer.position() + size);
- ByteBuffer result = currentBuffer.slice();
+ ByteBuffer result = currentBuffer.slice().order(currentBuffer.order());
currentBuffer.position(currentBuffer.limit());
currentBuffer.limit(currentBuffer.capacity());
return result;