diff options
Diffstat (limited to 'src/classes')
-rw-r--r-- | src/classes/share/javax/media/j3d/J3DBuffer.java | 13 |
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; } |