summaryrefslogtreecommitdiffstats
path: root/src/classes/share
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2013-03-16 21:49:45 -0700
committerHarvey Harrison <[email protected]>2013-03-16 21:49:45 -0700
commit0dd6ef1cf40744abfa5fc7eb18ccd26a6cdddb12 (patch)
treec4d7a64a71240a311cb0596b29ff73cedfcb1229 /src/classes/share
parentbf98f9c86995df14004a0de2f524fb2643481862 (diff)
j3dcore: explicitly store the readonlyBuffer copy in preparation to remove BufferWrapper
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes/share')
-rw-r--r--src/classes/share/javax/media/j3d/J3DBuffer.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/classes/share/javax/media/j3d/J3DBuffer.java b/src/classes/share/javax/media/j3d/J3DBuffer.java
index 17fcd61..8abaeae 100644
--- a/src/classes/share/javax/media/j3d/J3DBuffer.java
+++ b/src/classes/share/javax/media/j3d/J3DBuffer.java
@@ -74,6 +74,7 @@ enum Type {
}
private Buffer originalBuffer = null;
+ private Buffer readonlyBuffer = null;
private BufferWrapper bufferImpl = null;
Type bufferType = Type.NULL;
@@ -188,19 +189,23 @@ enum Type {
case BYTE:
ByteBuffer byteBuffer = ((ByteBuffer)buffer).asReadOnlyBuffer();
byteBuffer.rewind();
+ readonlyBuffer = byteBuffer;
bufferImpl = new ByteBufferWrapper(byteBuffer);
break;
case FLOAT:
FloatBuffer floatBuffer = ((FloatBuffer)buffer).asReadOnlyBuffer();
floatBuffer.rewind();
+ readonlyBuffer = floatBuffer;
bufferImpl = new FloatBufferWrapper(floatBuffer);
break;
case DOUBLE:
DoubleBuffer doubleBuffer = ((DoubleBuffer)buffer).asReadOnlyBuffer();
doubleBuffer.rewind();
+ readonlyBuffer = doubleBuffer;
bufferImpl = new DoubleBufferWrapper(doubleBuffer);
break;
default:
+ readonlyBuffer = null;
bufferImpl = null;
}
}
@@ -215,6 +220,14 @@ enum Type {
return originalBuffer;
}
+/**
+ * Gets the readonly view of the nio buffer we wrapped with J3DBuffer
+ * @return
+ */
+Buffer getROBuffer() {
+ return readonlyBuffer;
+}
+
BufferWrapper getBufferImpl() {
return bufferImpl;
}