23#include <Inventor/SbBase.h>
24#include <Inventor/SbPImpl.h>
25#include <Inventor/misc/SoRefCounter.h>
26#include <Inventor/SoTypedObject.h>
27#include <Inventor/SoSubTypedClass.h>
28#include <Inventor/devices/SoDeviceContext.h>
29#include <Inventor/threads/SbThreadSpinlock.h>
30#include <Inventor/STL/limits>
31#include <Inventor/renderer/RendererResourceMacro.h>
35#pragma warning(disable:4251)
40class SoCpuBufferObjectCache;
49#define SO_BUFFER_SIZE_ALL ((std::numeric_limits<size_t>::max)())
197 SO_TYPED_CLASS_ABSTRACT_HEADER()
402 void forceSize(
size_t size);
412 size_t startPosition,
size_t size);
415 void clearMappedBufferObject();
421 uint64_t getModificationsCounter()
const;
426 void incrementModificationsCounter()
const;
436 static SoCpuBufferObjectCache* getBufferObjectCache();
463 bool checkCopyConditions(
size_t sourceSize,
size_t sourceOffset,
464 size_t targetSize,
size_t targetOffset,
size_t copySize);
482 static SoCpuBufferObjectCache* s_bufferObjectCache;
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
AccessMode
This enum provides the possible access modes for a mapped buffer object.
@ READ_ONLY
The target buffer initially has the same contents as the source buffer.
@ SET
The target buffer contents are initially undefined (although they may be the same as the source buffe...
@ READ_WRITE
The target buffer initially has the same contents as the source buffer and the source buffer will con...
virtual void map(SoBufferObject *targetBufferObject, AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL)
Maps the current buffer object into the specified buffer object.
virtual void * map(AccessMode accessMode, size_t offset=0, size_t count=SO_BUFFER_SIZE_ALL)
Map the buffer to a system memory address and allows the mapping of a sub part of the buffer object i...
virtual size_t getSize() const
Returns the size, in bytes, of the buffer object.
virtual void unmap(SoBufferObject *bufferObject)
Unmap this buffer from the specified buffer object.
virtual void memcpy(SoBufferObject *sourceBufferObject, size_t destOffset=0, size_t sourceOffset=0, size_t copySize=SO_BUFFER_SIZE_ALL)
Copies data from the specified buffer object into this buffer object.
void unlockBuffer()
Unlocks the buffer object.
virtual void memset(void *value, size_t valueSize=1, size_t offset=0, size_t count=SO_BUFFER_SIZE_ALL)
This function sets the contents of (or a portion of) this buffer object to the specified value.
AccessMode getMappedBufferObjectAccessMode()
Returns the access mode used for the buffer mapping.
size_t getMappedBufferObjectSize() const
Returns the size of the mapped area in bytes.
size_t getMappedBufferObjectPosition() const
Returns the position in the source buffer mapped in this buffer.
virtual bool setSize(size_t size)
Sets the size in bytes of the buffer object.
SoDeviceContext * getContext() const
Returns the device context where this buffer is valid.
SoBufferObject * getMappedBufferObject() const
Returns a pointer to the buffer object which is mapped by the actual object.
virtual void unmap()
Unmaps the buffer from CPU address space.
virtual SoBufferObject * createInstance() const =0
Create a new buffer with the same properties as the current one.
virtual void clearInstance()=0
Free the memory allocated by the buffer object.
#define SO_BUFFER_SIZE_ALL
Used to indicate that we want to use the whole buffer.
void lockBuffer()
Locks the buffer against concurrent calls from different threads.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> CPU buffer objec...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Base class for ref-counted objects.
Base class for object storing runtime type information.