public class SoCpuBufferObject extends SoBufferObject
See SoBufferObject
for general information about buffer objects.
See SoBufferedShape
for an example of storing vertices in a CPU buffer.
Load data into a buffer object from an array in memory: Access data stored in a buffer object.
See also:
SoBufferObject.AccessModes
Inventor.ConstructorCommand
READ_ONLY, READ_WRITE, SET, SO_BUFFER_SIZE_ALL
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoCpuBufferObject()
Default constructor.
|
SoCpuBufferObject(java.nio.ByteBuffer buffer)
Constructor that takes an existing block of CPU memory.
|
Modifier and Type | Method and Description |
---|---|
void |
clearInstance()
Free the memory allocated by the buffer object.
|
java.nio.ByteBuffer |
map(SoBufferObject.AccessModes accessMode)
Map the buffer to a system memory address.
|
void |
map(SoGLBufferObject targetBufferObject,
SoBufferObject.AccessModes accessMode)
Calls map(targetBufferObject, accessMode, (long)0, (long)SO_BUFFER_SIZE_ALL).
|
void |
map(SoGLBufferObject targetBufferObject,
SoBufferObject.AccessModes accessMode,
long startPosition)
Calls map(targetBufferObject, accessMode, startPosition, (long)SO_BUFFER_SIZE_ALL).
|
void |
map(SoGLBufferObject targetBufferObject,
SoBufferObject.AccessModes accessMode,
long startPosition,
long mappingSize)
Map the current buffer object into the specified GL buffer object.
|
void |
memcpy(SoGLBufferObject sourceBufferObject)
Calls memcpy(sourceBufferObject, (long)0, (long)0, (long)SO_BUFFER_SIZE_ALL).
|
void |
memcpy(SoGLBufferObject sourceBufferObject,
long destOffset)
Calls memcpy(sourceBufferObject, destOffset, (long)0, (long)SO_BUFFER_SIZE_ALL).
|
void |
memcpy(SoGLBufferObject sourceBufferObject,
long destOffset,
long sourceOffset)
Calls memcpy(sourceBufferObject, destOffset, sourceOffset, (long)SO_BUFFER_SIZE_ALL).
|
void |
memcpy(SoGLBufferObject sourceBufferObject,
long destOffset,
long sourceOffset,
long copySize)
Copy data from the specified GL buffer object into this buffer object.
|
void |
setBuffer(java.nio.ByteBuffer buffer)
Request that the buffer object manage an existing block of memory.
|
boolean |
setSize(long size)
Sets the size in bytes of the buffer object.
|
void |
unmap()
Unmap a buffer mapped to a system memory address.
|
void |
unmap(SoGLBufferObject bufferObject)
Unmap the specified GL buffer object.
|
createInstance, dispose, getBufferObjectCache, getContext, getMappedBufferObject, getMappingAccessMode, getMappingSize, getMappingStartPosition, getSize, isDisposable, lockBuffer, map, map, map, map, map, map, memcpy, memcpy, memcpy, memcpy, memcpy, memcpy, memcpy, memcpy, setMappedBufferObject, setMappingAccessMode, setMappingZoneInformation, unlockBuffer, unmap, unmap
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public SoCpuBufferObject(java.nio.ByteBuffer buffer)
buffer
- Pointer to the buffer to manage.
size
- Size of buffer in bytes.public SoCpuBufferObject()
public void clearInstance()
SoBufferObject
clearInstance
in class SoBufferObject
public boolean setSize(long size)
SoBufferObject
setSize
in class SoBufferObject
size
- The requested size in bytes.
public void map(SoGLBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode, long startPosition)
public void memcpy(SoGLBufferObject sourceBufferObject, long destOffset)
public void memcpy(SoGLBufferObject sourceBufferObject)
public void map(SoGLBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode)
public void memcpy(SoGLBufferObject sourceBufferObject, long destOffset, long sourceOffset)
public void memcpy(SoGLBufferObject sourceBufferObject, long destOffset, long sourceOffset, long copySize)
This is an optimized implementation. See the general memcpy method for more information.
public void map(SoGLBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode, long startPosition, long mappingSize)
public void unmap(SoGLBufferObject bufferObject)
public void setBuffer(java.nio.ByteBuffer buffer)
We recommend to use the most aligned memory pointer possible to enable optimized algorithm usage (ie. SSE/Altivec computing, CUDA memory mapping, etc).
NOTE: If another buffer object is currently mapped into another buffer, the other buffer is automatically unmapped and its contents are undefined.
public java.nio.ByteBuffer map(SoBufferObject.AccessModes accessMode)
public void unmap()
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com