23#if !defined SOGLBUFFEROBJECT_H
24#define SOGLBUFFEROBJECT_H
26#include <Inventor/devices/SoInteropBufferObject.h>
27#include <Inventor/sys/SoGLType.h>
229 SO_TYPED_CLASS_HEADER();
<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.
#define SO_BUFFER_SIZE_ALL
Used to indicate that we want to use the whole buffer.
<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> OpenGL buffer ob...
virtual void unmap(SoBufferObject *bufferObject)
Unmap the specified buffer object.
void bind()
Bind the current buffer to the specified target so it's usable by OpenGL operations.
Usage
This enum declares the possible usages of the memory allocated for the buffer.
@ STATIC_DRAW
The data store contents will be modified once and used many times.
@ DYNAMIC_READ
The data store contents will be modified repeatedly and used many times.
@ DYNAMIC_DRAW
The data store contents will be modified repeatedly and used many times.
@ STATIC_COPY
The data store contents will be modified once and used many times.
@ STATIC_READ
The data store contents will be modified once and used many times.
@ STREAM_COPY
The data store contents will be modified once and used at most a few times.
@ DYNAMIC_COPY
The data store contents will be modified repeatedly and used many times.
@ STREAM_DRAW
The data store contents will be modified once and used at most a few times.
@ STREAM_READ
The data store contents will be modified once and used at most a few times.
virtual void * map(AccessMode accessMode, size_t offset=0, size_t count=SO_BUFFER_SIZE_ALL)
This function extends the map(AccessMode) method by allowing the mapping of a sub part of the buffer ...
static bool isAvailable()
Query if SoGLBufferObjects are available on this system.
virtual void unmap()
Unmaps the buffer using the regular unmap function.
virtual bool setSize(size_t size)
Set the size of the buffer in bytes.
virtual void clearInstance()
Free the memory allocated in the buffer object.
BufferObjectTarget
This enum declares the possible targets of the buffer.
@ PIXEL_PACK_BUFFER
The buffer is used as a pixel pack buffer, it can be used as texture.
@ PIXEL_UNPACK_BUFFER
The buffer is used as a pixel unpack buffer, it can be used for readback operation.
@ SHADER_STORAGE_BUFFER
The buffer is used as a shader storage buffer, it can be used to perform random access reads,...
@ ARRAY_BUFFER
The buffer is used as an array buffer, it can be used for vertices, normals, colors.
@ ELEMENT_ARRAY_BUFFER
The buffer is used as a pixel pack buffer, it is used to specify the indices for indexed geometries.
virtual void map(SoBufferObject *targetBufferObject, AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL)
Map the current buffer object into the specified buffer object.
virtual SoBufferObject * createInstance() const
Create a new buffer with the same properties as the current one.
bool isValid()
Query if the buffer is valid in the current context.
GLuint getId() const
Returns the OpenGL id of the buffer.
void unbind()
Unbind the buffer.
void setTarget(BufferObjectTarget target)
Specify the buffer target, which defines possible usage of the buffer.
void memcpy(SoBufferObject *source, size_t destOffset=0, size_t sourceOffset=0, size_t copySize=SO_BUFFER_SIZE_ALL)
Copy data from a buffer into this GL buffer.
SoGLBufferObject(Usage usage)
Constructor.
BufferObjectTarget getTarget() const
Returns the current buffer target.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...