public abstract class SharedMemoryVertexBufferObject extends ZeroMemoryVertexBufferObject
ZeroMemoryVertexBufferObject, all SharedMemoryVertexBufferObjects share a single ByteBuffer which is used by whichever SharedMemoryVertexBufferObject instance is currently buffering data,
at the cost of expensive data buffering (up to 5x slower!) and a little synchronization overhead.
Usually a SharedMemoryVertexBufferObject is preferred to a ZeroMemoryVertexBufferObject when the following conditions need to be met:
IDisposable.AlreadyDisposedExceptionmAutoDispose, mCapacity, mDirtyOnHardware, mDisposed, mHardwareBufferID, mUsage, mVertexBufferObjectAttributes, mVertexBufferObjectManagerHARDWARE_BUFFER_ID_INVALID| Constructor and Description |
|---|
SharedMemoryVertexBufferObject(VertexBufferObjectManager pVertexBufferObjectManager,
int pCapacity,
DrawType pDrawType,
VertexBufferObjectAttributes pVertexBufferObjectAttributes) |
| Modifier and Type | Method and Description |
|---|---|
protected java.nio.ByteBuffer |
aquireByteBuffer()
When a non
null ByteBuffer is returned by this function, it is guaranteed that ZeroMemoryVertexBufferObject.releaseByteBuffer(ByteBuffer) is called. |
void |
dispose() |
static int |
getSharedByteBufferByteCapacity() |
protected void |
releaseByteBuffer(java.nio.ByteBuffer byteBuffer) |
bind, bind, draw, draw, finalize, getByteCapacity, getCapacity, getGPUMemoryByteSize, getHardwareBufferID, getHeapMemoryByteSize, getNativeHeapMemoryByteSize, getVertexBufferObjectManager, isAutoDispose, isDirtyOnHardware, isDisposed, isLoadedToHardware, onPopulateBufferData, setDirtyOnHardware, setNotLoadedToHardware, unbind, unloadFromHardwarepublic SharedMemoryVertexBufferObject(VertexBufferObjectManager pVertexBufferObjectManager, int pCapacity, DrawType pDrawType, VertexBufferObjectAttributes pVertexBufferObjectAttributes)
public static int getSharedByteBufferByteCapacity()
public void dispose()
dispose in interface IDisposabledispose in class ZeroMemoryVertexBufferObjectprotected java.nio.ByteBuffer aquireByteBuffer()
ZeroMemoryVertexBufferObjectnull ByteBuffer is returned by this function, it is guaranteed that ZeroMemoryVertexBufferObject.releaseByteBuffer(ByteBuffer) is called.aquireByteBuffer in class ZeroMemoryVertexBufferObjectByteBuffer to be passed to ZeroMemoryVertexBufferObject.onPopulateBufferData(ByteBuffer).protected void releaseByteBuffer(java.nio.ByteBuffer byteBuffer)
releaseByteBuffer in class ZeroMemoryVertexBufferObject